C H A P T E R 11 |
Subscriber API |
The Subscriber API provides access to data maintained by Content Delivery Server. Use this API to get the data needed to create your own client application for providing subscribers with access to content managed by Content Delivery Server.
Clients that are written in the Java programming language and located on a server with the Subscriber Portal component of Content Delivery Server can call the Subscriber API directly. Clients written in a programming language other than Java, or clients that are located on a server that does not contain the Subscriber Portal must access the Subscriber API through the XML-RPC (remote procedure call) implementation.
The Subscriber API includes the following classes and interfaces that your client might use:
For additional information on these and other classes, see the HTML output of the Javadoc tool at $CDS_HOME/javadoc/cdsapi/index.html.
This section describes general tasks that you might want your client application to perform. The class names used in this section refer to the classes that make up the Subscriber API. See Section 11.3, XML-RPC Implementation for the equivalent handler if you are accessing Content Delivery Server data using XML-RPC.
An authentication key is used to authenticate requests for access to Content Delivery Server. This key is included in the IApiContext object and is generated when an IApiContext object is created. An authentication key is required to create a service and expires if not used within a set number of minutes. The default period is 10 minutes. To change the period, set the subscriberApi.authkey.timeout.minutes property in the $CDS_HOME/deployment/deployment-name/conf/SubscriberPortal.properties file. If the key expires, you must create a new IApiContext object to get a new key.
In general, the client application that you create for your subscriber interface includes actions such as those described in the following list.
The IApiContext object describes either a specific subscriber or an anonymous subscriber. This object is used by all services to retrieve data specific to the subscriber described by the object. Typically, you would create the IApiContext object once per user session and store the authentication key in the HttpSession object. To get the authentication key, call the IApiContext.getAuthKey method. See Section 11.2.2, Example of Creating an IApiContext Object for sample code.
The services that you create depend on the tasks that you want to perform. For example, to enable a subscriber to purchase a gift for another subscriber, create an IGiftingService object. To provide a subscriber with the list of content already purchased, create an IContentService object. You must have an authentication key to create a service. Each service created provides data specific to the subscriber described by the IApiContext object. See Section 11.2.3, Example of Creating a Service for sample code.
For example, if you created an IContentService, call the getCampaigns method to get the list of campaigns available to the subscriber or the getPurchases method to get the list of items that the subscriber has already purchased.
When you are done, remove the authentication key by calling the IApiContextFactory.removeApiContext method.
The classes for the Subscriber API are in the package com.sun.content.server.subscriberapi. This package is included in the subscriberportal.jar file in one of the following locations:
deployment-name is the name specified when the Catalog Manager was deployed, server-domain is the value specified in the deployment configuration file for the app.server.domain property.
If your client application is a Java application, create your client using the Subscriber API classes in the subscriberportal.jar file. This JAR file must be in your classpath when you compile your application.
To execute, place the JAR file that contains your client in the same $CDS_HOME/deployment/deployment-name/.../lib directory that contains the subscriberportal.jar file. Your client must run within the same web application structure as the Subscriber Portal provided with Content Delivery Server. Stand-alone Java applications are not supported.
If your client is not a Java application or will not be located on the same server as the Subscriber Portal, see Section 11.3, XML-RPC Implementation for information on accessing the Subscriber API through XML-RPC.
A transaction occurs each time you create an instance of a service and call its methods to perform a task. Your application must manage the transactions with Content Delivery Server as described in the following steps:
1. Before a service is invoked, call the ApiUtil.initTransaction method to indicate the start of a transaction.
2. If the transaction completes successfully, call the ApiUtil.commitTransaction method to commit the work done. If an error occurs during the transaction, call the ApiUtil.rollbackTransaction method to terminate the work and restore the data to its previous state.
3. The transaction resources must be released in a finally block that calls the ApiUtil.disposeTransaction method.
See the code examples in Section 11.2.2, Example of Creating an IApiContext Object and Section 11.2.3, Example of Creating a Service for sample implementations.
The following code excerpt shows how to create an IApiContext object.
The following code excerpt shows how to create a Content Service and use that service to purchase content.
If your client is not a Java application or is not running on the server with Content Delivery Server, your client must communicate with Content Delivery Server using XML-RPC. XML-RPC enables your client to make remote procedure calls using HTTP for the transport and XML for data encoding. You can use XML-RPC with many different programming languages by using bindings available on the Internet. All of the functionality of the Subscriber API is available through XML-RPC.
Note - A tutorial on XML-RPC is beyond the scope of this document. Information on writing applications that use XML-RPC is available from various web sites on the Internet. |
To obtain data from Content Delivery Server, your client must be able to communicate with Content Delivery Server. Work with your network administrator to ensure that the client can contact Content Delivery Server and that any required proxy or firewall is configured to allow this access.
In addition, Content Delivery Server must recognize that your client is authorized to make requests for data. The subscriberApi.xml-rpc.trustedHosts property in the $CDS_HOME/deployment/deployment-name/conf/SubscriberPortal.properties file contains the list of hosts from which requests are accepted.
Set the subscriberApi.xml-rpc.trustedHosts property to the host name or IP address of the host on which your client is located, whether it is on the same host as Content Delivery Server or on a different host. To accept requests from any host, leave the value blank. To accept requests from more than one host, separate the host names or IP addresses with a comma, for example:
subscriberApi.xml-rpc.trustedHosts=127.0.0.1,localhost
The general flow of your application (see Section 11.1, General Process Flow) is similar whether you access the Subscriber API directly or through XML-RPC. In both cases, an API Context object is required to access services. When accessing the Subscriber API directly, the authentication key is used to create services. When using XML-RPC, the AuthenticationHandler is used to get an API Context object, which is passed in to every method.
Handlers in the XML-RPC implementation perform the same functions as the Subscriber API services. Each handler and its corresponding service have equivalent methods with equivalent parameters.
The following topics are presented in this section:
Use the following guidelines to code your calls to the handlers. The sample code is written in the Java programming language.
... // Set up the input parameters Vector parameters = new Vector(); Hashtable ht = new Hashtable(); ht.put("username", "user1"); ht.put("password", "cryptic1"); parameters.addElement(ht); ... |
... // Send the request to Content Delivery Server Hashtable response = (Hashtable) client.execute("AuthenticationHandler.getApiContext", parameters); ... |
... // Evaluate the response String errorCode = (String)response.get("response_code"); if (!errorCode.equals("1")) { // Handle Error System.out.println((String)response.get("response_message")); } |
The following sections describe the handlers that you can use. Examples are provided in Section 11.3.3, Examples of Using Handlers.
AuthenticationHandler is equivalent to the ApiContextFactory class. This handler creates the API Context object that contains the characteristics of the subscriber. The API Context object is equivalent to the IApiContext object. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
AuthenticationHandler.getApiContext
The following table describes the AuthenticationHandler methods.
Returns[1] |
|||
---|---|---|---|
Authenticates the subscriber based on the information provided and create an API Context object that contains the information for that subscriber. |
CategoryHandler is equivalent to the ICategoryService interface. This handler provides access to the category tree and a subscriber’s category list. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
CategoryHandler.getCategory
The following table describes the CategoryHandler methods.
Returns[2] |
|||
---|---|---|---|
Gets an entire branch of the category tree beginning with the category specified in categoryId. To get the entire tree, specify the root category. The categories returned contain the type of content listed in contentTypeIdList with a status listed in statusList. If contentTypeIdList is not provided, all content types are considered. If statusList is not provided, all statuses are considered. |
apiContext, categoryId, contentTypeIdList (option), statusList (optional), includeContentCount |
||
For the category specified in categoryId, gets the list of subcategories that contain the type of content listed in contentTypeIdList with a status listed in statusList. If contentTypeIdList is not provided, all content types are considered. If statusList is not provided, all statuses are considered. |
apiContext, categoryId, contentTypeIdList (optional), statusList (optional), includeContentCount |
||
For the category specified in categoryId, gets the list of all subcategories. |
|||
hideCategory[3] |
Hides the categories specified in categoryIds that the subscriber has chosen to not view and return the updated list. |
||
moveCategoryDown* |
Moves each category specified in categoryIds down one position below the next active category and return the updated list. |
||
moveCategoryUp* |
Moves each category specified in categoryIds up one position above the next active category and return the updated list. |
||
showCategory* |
Shows the categories specified in categoryIds that the subscriber has selected and return the updated list. |
||
Updates the information in the database for the categories in categoryList. |
ContentHandler is equivalent to the IContentService interface. This handler provides access to the content for browsing, searching, retrieving, and purchasing. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
ContentHandler.browseContent
The following table describes the ContentHandler methods.
Returns[4] |
|||
---|---|---|---|
Adds an item of content to the subscriber’s list of bookmarked content. |
|||
Gets the number of items specified in numberToReturn in the category specified in categoryId that are of the types specified in contentTypeIdList. If contentTypeIdList is not provided, all content types are included. Note - This method is deprecated. Use the new version of the searchContent method. |
apiContext, categoryId, contentTypeIdList (optional), startIndex, numberToReturn |
||
Cancels the subscriber’s subscription to an item of content. |
|||
Deletes an item of content from the subscriber’s list of bookmarked content. |
|||
Gets the information for a campaign that is associated with the coupon specified. Call this method if the subscriber is anonymous. |
|||
Gets the information for a campaign that is associated with the coupon specified. Call this method if the subscriber is known. |
|||
Gets the list of campaigns that are available to the subscriber. |
|||
Gets the content ID for a specific edition of the content identified by contentClassId. |
|||
Gets the content ID for a specific edition of the content identified by contentKeyword. |
|||
Gets an empty criteria object, which can be used for methods that accept criteria as a parameter. |
|||
Gets the information for each item of content specified in contentIdList. |
|||
Gets the list of bundles purchased by the subscriber that contain the item of content specified in contentId. |
|||
Gets the purchase ticket for the content identified by contentId. |
apiContext, contentId, bundleId (specify only if content is part of a bundle) |
||
Determines if the content specified in contentId is in the campaign specified in campaignId. |
|||
Determines if the content can be pushed to the device using MMS. |
|||
Determines if the content can be pushed to the device using SMS. |
|||
Purchases content. If campaignID is specified, purchases content that is part of a campaign. Not available for anonymous subscribers. |
apiContext, contentId, campaignId (optional), isSkipTrial |
||
Sends content to a subscriber. Content must first be purchased. |
|||
Gets the list of content summaries for content that matches the search query. |
|||
Gets the list of content that matches the search criteria. The category tree is searched beginning with the category specified in categoryId. To search all content, specify the root category (see the getRootCategory method in CategoryHandler.) |
contentTypeIdList (optional), keyword, startIndex, numberToReturn |
DownloadHandler is equivalent to the IDownloadService interface. This handler provides access to the descriptors needed to download content. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
DownloadHandler.downloadConfirm
The following table describes the DownloadHandler methods.
Returns[5] |
|||
---|---|---|---|
Downloads the binary file for the item of content specified by contentId. |
|||
Creates a content descriptor file and return it to the caller. |
|||
Creates a Java Application Descriptor (JAD) file and return it to the caller. |
|||
Creates an application descriptor file for an iAppli application and return it to the caller. |
|||
Pushes content to the device using MMS. Note - This method is deprecated. Use the pushMMSContentByTicket method. |
|||
Pushes content identified by codedTicket to the device using MMS. |
|||
apiContext, mobileId, contentBinary, mimeType, contentType, smsParams |
|||
Pushes content identified by codedTicket to the device using SMS. |
|||
GiftingHandler is equivalent to the IGiftingService interface. This handler enables gifts or notifications about content to be sent to another subscriber. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
GiftingHandler.createGifting
The following table describes the GiftingHandler methods.
Returns[6] |
|||
---|---|---|---|
Gets the information about the gift specified by giftTicket. |
|||
Gets the information for all of the gifts given by the subscriber. |
|||
Gets the information for all of the gifts received by the subscriber. |
|||
Purchases an item of content as a gift for another subscriber. |
apiContext, contentId, campaignId (optional), recipientApiContext, message, giftedDownloads, giftedSubscriptions |
||
Determines if the recipient claimed all of the uses provided by the gift. |
|||
Sends a message about an item of content to another subscriber. |
MessageHandler is equivalent to the IMessageService interface. This handler enables email, SMS, WAP push, and MMS messages to be sent to the current subscriber or to another subscriber. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
MessageHandler.sendMessageToSelf
The following table describes the MessageHandler methods.
Returns[7] |
|||
---|---|---|---|
Sends a message to the number specified by the mobile ID provided. |
apiContext, subject, message, url, mobileId, contentId, messageCategory |
||
apiContext, messageType, subject, message, url, contentId, messageCategory |
|||
Sends a message to the subscriber identified by the subscriber ID provided. |
apiContext, messageType, subject, message, url, subscriberId, contentId, messageCategory |
||
Sends a message to the subscriber identified by the user name provided. |
apiContext, messageType, subject, message, url, username, contentId, messageCategory |
||
apiContext, mobileId, contentBinary, name, contentType, mimeType, subject, message, modelId, contentId, messageCategory |
StreamingHandler is equivalent to the IStreamingService interface. This handler provides Content Delivery Server with information about a streaming session and enables the streaming server to validate requests for content. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
StreamingHandler.authenticate
The following table describes the StreamingHandler methods.
Returns[8] |
|||
---|---|---|---|
Verifies that the subscriber who is requesting streamed content is known to Content Delivery Server. |
|||
Verifies that the subscriber who is requesting streamed content has purchased the item requested. |
|||
Notifies Content Delivery Server that a streaming session has ended. |
|||
Notifies Content Delivery Server that an error occurred during a streaming session |
|||
Notifies Content Delivery Server that a streaming session has started. |
SystemHandler is equivalent to the ISystemService interface. This handler provides access to system-level data such as content types, locales, and models. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
SystemHandler.getContentTypes
The following table describes the SystemHandler methods.
Returns[9] |
|||
---|---|---|---|
Creates a ticket for a subscriber to use to retrieve an item of content. |
|||
Gets a list of all of the content types that are defined in Content Delivery Server. |
|||
Gets a list of all of the countries that are included in Content Delivery Server. |
|||
Gets a list of all of the locales included in Content Delivery Server. |
|||
Gets the names of all of the device manufacturers included in Content Delivery Server. |
|||
Gets the internal ID for the device associated with the user agent specified in modelId. |
|||
Gets a list of all of the devices supported by Content Delivery Server. |
|||
Gets the models in Content Delivery Server for a given manufacturer. Only models that are not quarantined are returned. |
|||
Determines if the ticket for an item of content can be used by the subscriber. |
|||
Sends the system event specified in eventType. Note - This method is deprecated. The functionality is no longer required. |
apiContext, subscriberId, mobileId, contentId (optional), eventType |
||
UserHandler is equivalent to the IUserService interface. This handler provides access to information on subscribers and enables new subscriber accounts to be created. The guidelines for calling a method in a handler are described in Section 11.3.2.1, Guidelines for Calls to XML-RPC Methods. To call a method, concatenate the name of the handler with the name of the method, for example:
UserHandler.getSubscriberId
The following table describes the UserHandler methods.
Returns[10] |
|||
---|---|---|---|
Disables the account for the subscriber identified by the subscriber ID. |
|||
Disables the account for the subscriber identified by the user name. |
|||
Gets the subscriber ID for the subscriber identified by the user name. |
|||
Gets the information for the subscriber identified by the subscriber ID. |
|||
Gets the information for the subscriber identified by the user name. |
|||
Populates a subscriber account in Content Delivery Server with information from an external subscriber database. |
|||
Sets the password for the subscriber identified by the subscriber ID to a value generated by the system. |
|||
Sets the password for the subscriber identified by the user name to a value generated by the system. |
|||
Changes the model ID to match the new device that the subscriber is using. |
|||
Sets the preferences selected by a subscriber. These preferences manage the information that is shown to the user. |
|||
Creates a subscriber account in Content Delivery Server and in any external subscriber database. |
apiContext, username, password, modelId, mobileId, uniqueId, localeCode |
||
Creates a subscriber account in Content Delivery Server and in any external subscriber database and set the information and preferences for that subscriber. |
apiContext, username, password, modelId, mobileId, uniqueId, localeCode, propertyList, preferenceList |
The following table describes the parameters for the methods. Container objects such as Hashtable and Vector contain elements that are also described in the table.
Container for the information about a subscriber. This container includes the following items:
Note - For an anonymous subscriber, only subscriberId, localeCode, and modelId are included. |
||
Internal ID that was assigned by Content Delivery Server to an individual item in a bundle. |
||
Internal ID that was assigned by Content Delivery Server to the bundle with which you are working. |
||
Container for the information about a campaign. This container includes the following items: |
||
Percentage by which the items in the campaign are discounted. |
||
Date that the campaign expires. If the campaign is expired, null is returned. |
||
Internal ID that was assigned by Content Delivery Server to the campaign with which you are working. |
||
Vector, elements of type campaign |
||
Promotional message included in the notifications sent to subscribers to announce the campaign. |
||
Subject added to email notifications sent to subscribers to announce the campaign. |
||
Container for information about a category. This container includes the following items:
|
||
Internal ID that was assigned by Content Delivery Server to the category with which you are working. |
||
List of category IDs. Categories are identified by the internal ID that was assigned by Content Delivery Server. |
||
Vector, elements of type category |
||
String that identifies the purchase ticket for the download request. |
||
Container for the information about an item of content. This container includes the following items:
|
||
Unique identifier that identifies an item of content in the Catalog Manager. The class ID refers to an item and all of the editions associated with that item. |
||
Internal ID that was assigned by Content Delivery Server to the item of content with which you are working. |
||
Vector, elements of type contentId |
||
Keyword used to identify content, typically used for content delivered directly to a device using SMS. |
||
List of items of content. When returned by the getContentDetailsList method of ContentHandler, the vector elements are of type content. When returned by other methods of ContentHandler, the vector elements are of type contentSummary. |
||
Container for summary information about an item of content. This container includes the following items: |
||
Type of content with which you are working. This type must be one of the content types defined in the contentTypeList. When returned by the methods of DownloadHandler, this is the MIME type of the binary data or descriptor. |
||
List of content type IDs. Content types are identified by the internal ID that was assigned by Content Delivery Server. |
||
Information about each content type defined in Content Delivery Server. Each element contains the following items: |
||
Container for information about a country. This container includes the following items: |
||
Two-character ISO code that represents the subscriber’s country, for example, US. |
||
Vector, elements of type country |
||
String that identifies the coupon that the subscriber is using to purchase content. |
||
Container for information about an item of content. This container includes the following items:
|
||
Container for information about a custom field that you defined for your installation of Content Delivery Server. This container includes the following items: |
||
Vector, elements of type customField |
||
String used to identify the custom field to Content Delivery Server. |
||
Type of data stored in the custom field. Valid values are boolean, number, text, and timestamp. |
||
Internal ID that was assigned by Content Delivery Server to identify the custom field. |
||
String used in the user interface to identify the custom field. |
||
Identifies whether the field applies to the content item or to an edition of the content item. |
||
Type of delivery used to deliver content. The following values are valid: |
||
Description of the object. Depending on the method called, this is the description of the category, the campaign, the device, or the locale. |
||
Binary form of the content descriptor as base64-encoded data. When returned by the downloadContent method of DownloadHandler, this is the content binary file. |
||
Position of the category in the list of categories. 1 indicates the top of the list. |
||
Estimated time that it takes to download the content. Each element corresponds to an element in the networks object to indicate the estimated time that the download takes over the corresponding type of network. |
||
Type of event with which you are working. Use sms_request_for_content to indicate that the event is a request for information about an item of content. |
||
Container for Boolean flags that indicate the type of information to return. Information of the type associated with each flag is returned only if the flag is included in the hash table and is set to true. The following flags are valid when working with ContentHandler:
Note - If filterDetailsResourceBinaries is not specified in the filter, the binary of a preview file is not available in the preview object. An attempt to get the binary from the preview object returns null. If filterDetailsResourceURLs is not specified in the filter, the URL of a preview file is not available in the preview object. An attempt to get the URL from the preview object returns the empty string. If neither of these flags is included in the filter, previewListMap is null and no access to preview files is provided. The following flags are valid when working with GiftHandler: |
||
Subscriber’s gender. Valid values and what each value indicates are described in the following list: |
||
Internal ID that is assigned by Content Delivery Server to the gift with which you are working. |
||
Container for information about a gift. This container contains the following items: |
||
Flag that indicates if the content provided by the gift exists on the target device. True indicates that the content is on the device. False indicates that the content is not on the device. |
||
Vector, elements of type gifting |
||
Subscriber ID for the subscriber who is the recipient of a gift. |
||
Mobile ID for the subscriber who is the recipient of a gift. |
||
Model ID of the device for the subscriber who is the recipient of a gift |
||
Status of a gift. Valid values and what each value indicates are described in the following list: |
||
Internal object used to validate that the subscriber can access the gift. |
||
Flag that indicates if a subscriber has purchased content. True indicates that the subscriber has purchased content. False indicates that the subscriber has not purchased content. |
||
Internal ID that was assigned by Content Delivery Server to the locale, or the content type, that you are working with. |
||
Flag that indicates if the number of items in a category is calculated. True indicates that the number is calculated. False indicates that the number is be calculated. |
||
When included in the category object, this flag indicates if the category is shown to the subscriber. True indicates that the category is shown. False indicates that the category is not shown. When included in the content object, this flag indicates if the content is active. True indicates that the content is active. False indicates that the content is inactive. |
||
Flag that indicates if the subscriber is anonymous. True indicates that the subscriber is anonymous. False indicates that the subscriber is known. |
||
Flag that indicates if the person attempting to access streamed content is an authentic Content Delivery Server subscriber or that the subscriber has purchased the item requested. |
||
Flag that indicates if the subscriber has bookmarked the content. True indicates that content is bookmarked. False indicates that the content is not bookmarked. |
||
Flag that indicates if the item is a bundle. True indicates that the item is a bundle. False indicates that the item is not a bundle. |
||
Flag that indicates if the item is included in a bundle. True indicates that the item is part of a bundle. False indicates that the item is not part of a bundle. |
||
Flag that indicates if the subscriber has customized the categories that are shown. True indicates that the categories are customized. False indicates that the categories are not customized. |
||
Flag that indicates if the item of content is included in a campaign. True indicates that the item is in the campaign. False indicates that the item is not in the campaign. |
||
Flag that indicates if the device is the default device. True indicates that the device is the default device. False indicates that the device is not the default device. |
||
Flag that indicates if content has been downloaded. True indicates that an item of content has been downloaded. False indicates that an item of content has not been downloaded. |
||
Flag that indicates if the subscriber is automatically charged for additional downloads after the number of purchased downloads is exceeded. True indicates that renewal is automatic. False indicates that the subscriber must manually purchase additional downloads. |
||
Flag that indicates if the content is free. True indicates that the content is free. False indicates that the content must be purchased. |
||
Flag that indicates if the gift is expired. True indicates that the gift is expired and can no longer be claimed. False indicates that the gift is not expired. |
||
Flag that indicates if all of the uses purchased for the gift were used by the recipient. True indicates that all of the uses that were purchased are used. False indicates that not all of the uses that were purchased are used. |
||
Flag that indicates if the category has any subcategories. True indicates that the category does not have subcategories. False indicates that the category has subcategories. |
||
Flag that indicates if the content can be sent to the device using MMS. True indicates that MMS can be used. False indicates that MMS cannot be used. |
||
Flag that indicates if an item of content is on a subscriber’s device. True indicates that the item is on the device. False indicates that the item is not on the device. |
||
Flag that indicates if one-step or two-step download is used. True indicates that it is a one-step download. False indicates that it is a two-step download. |
||
Flag that indicates if an entry for the subscriber exists in the Content Delivery Server database. True indicates that an entry does exist. False indicates that the subscriber is anonymous. |
||
Flag that indicates if the content must be purchased before being downloaded. True indicates that the content must be purchased first. False indicates that content can be downloaded. |
||
Flag that indicates if the device is push enabled. True indicates that the device is push enabled. False indicates that the device is not push enabled. |
||
Flag that indicates if the subscriber is registered in an external subscriber database. True indicates that the subscriber is registered. False indicates that the subscriber is not registered. |
||
Flag that indicates if the subscriber chooses to skip the trial usage. True indicates that the subscriber chooses to skip the trial usage so the content can be purchased immediately. False indicates that the subscriber chooses not to skip the trial usage. |
||
Flag that indicates if the content can be sent to the device using SMS. True indicates that SMS can be used. False indicates that SMS cannot be used. |
||
Flag that indicates if the subscription has expired. True indicates that the subscription is expired. False indicates that the subscription is not expired. |
||
Flag that indicates if the subscription is automatically renewed. True indicates that renewal is automatic. False indicates that the subscriber must manually renew the subscription. |
||
Flag that indicates if the subscriber can use the ticket to get an item of content. True indicates that the subscriber can use the ticket. False indicates that the subscriber cannot use the ticket. |
||
Flag that indicates if the content can be used on a trial basis. True indicates that a trial is available. False indicates that no trial is available. |
||
Flag that indicates an update is available for the content. True indicates that an update is available. False indicates that an update is not available. |
||
Flag that indicates if a subscription for the content can be canceled. True indicates that the subscription can be canceled. False indicates that there is no subscription or that the subscription cannot be canceled. |
||
Flag that indicates if a subscriber has used the content for the number of uses purchased. True indicates that all purchased uses are used. False indicates that not all purchased uses are used. |
||
Flag that indicates if the content can be run on the model that the subscriber is using. True indicates that the content does run on the model. False indicates that the content does not run on the model. |
||
Two-character ISO code that represents the subscriber’s language, for example, en. |
||
Type of license associated with the content. Valid values and what each value indicates are described in the following list: |
||
Together with listStart, specifies the range of items to return. The alphabetized list ends with items that match the string specified. The string is case sensitive. Specify null to end at the end of the complete list. |
||
Together with listEnd, specifies the range of items to return. The alphabetized list begins with items that match the string specified. The string is case sensitive. Specify null to start at the beginning of the complete list. |
||
Container for locale information. This container contains the following items: |
||
String that represents the subscriber’s locale, for example, en_US. |
||
Vector, elements of type locale |
||
Vector, elements of type manufacturer |
||
Maximum number of items to deliver in a call. If more items exist than the number specified, no content is sent. To deliver all items, use -1. |
||
Category of message to be sent. Categories one through seven are sent to the subscriber, category 9 is sent to the Catalog Manager administrator. Valid values and what each value indicates are described in the following list:
|
||
Type of message to send. Valid values and what each value indicates are described in the following list: |
||
Container for device information. This container includes the following items: |
||
Internal ID that was assigned by Content Delivery Server to the device that you are working with. |
||
Vector, elements of type model |
||
Name of the object. Depending on the method, this is the name of the category, the country, the campaign, the device, or the content. |
||
List of network types that are known by Content Delivery Server. Each element corresponds to an element in the downloadTimes Vector to indicate the estimated time that the download takes for the corresponding network. |
||
Indicates if the subscriber wants to be notified about promotions. True indicates that the subscriber wants to be notified. False indicates that the subscriber does not want to be notified. |
||
Total number of times that the content was downloaded by all subscribers. |
||
Number of items to return in a list. To return all items, specify -1. |
||
Internal ID that was assigned by Content Delivery Server to the category that is the parent of the category that you are working with. |
||
Unencrypted password for the subscriber. Encryption is performed by Content Delivery Server. |
||
Flag that indicates if the subscriber’s password must be reset when the subscriber logs in. True indicates that the password must be reset. False indicates that the password does not need to be reset. |
||
Container for a subscriber’s preferences. This container includes items of type notifyPromotions. To delete a preference, set the value to the empty string (‘’). |
||
Container for information about a preview. This container includes the following items: |
||
String used to identify the preview. This string is optional and could be empty. If desired, your code can replace the empty string with the string of your choice. |
||
Date when the preview file was last changed. If you are caching preview files, use this date to determine if the cache needs to be updated. |
||
Container of preview files for both WAP previews and web previews. This container includes the following items: If neither filterDetailsResourceBinaries nor filterDetailsResourceURLs is specified in the filter, this item is null. If one of the flags is specified and one of the targets has no preview files, the list for that target is empty. |
||
Position of the file in the preview set. The position index of the first file in the preview set is 1. |
||
Type of browser for which the preview file is targeted. Valid values and what each value indicates are described in the following list: |
||
Container for pricing information for an item of content. This container includes the following items: |
||
Information about each subscriber. Each element contains the following items: |
||
Set of name-value pairs used to configure system behavior. These values are internal values used by Content Delivery Server. |
||
Information about each item purchased by the subscriber. Each element contains the following items: |
||
Container for the information about the recipient of a gift. This container includes the following items: |
||
Container for the HTTP headers associated with an HTTP request. |
||
Container for key-value pairs that provide information about an event. The following keys must be included:
Additional keys that your system recognizes can also be included. |
||
Code that indicates if the method executed successfully. 1 indicates successful completion. -1 indicates an error occurred. |
||
Role assigned to the subscriber. Valid values and what each value indicates are described in the following list: |
||
Value that indicates how relevant the item found is to the search query. High numbers indicate high relevancy. Valid values are 0.0 to 1.0. The default is 0.5. |
||
Container for the criteria used to filter the results of a content search. This container includes the following items: |
||
Any valid search query as defined by the Search Query Expression Language used by the Apache Lucene project. See http://lucene.apache.org/java/docs/queryparsersyntax.html for additional information. |
||
Container for parameters required to push binary content to a device. The entries in the hash table are pairs of strings that identify the name and value of each parameter needed. |
||
Attribute by which results from a query are sorted. This is the value set by the Vending Manager administrator for a category. If no value is set for the category, the query sort value for the closest parent category is used. If no parent category has a query sort value specified, null is used. |
||
Container for the fields by which search results are sorted. The entries in the hash map are String and Boolean pairs where the string is the name of the field on which to sort and the boolean indicates whether to sort in ascending or descending order. A value of true indicates ascending order, false indicates descending order. |
||
The position in a list of items at which to begin processing. |
||
Confirm status string returned by the device. For possible values returned by MIDP applications, see http://www.jcp.org/jsr/detail/118.jsp. |
||
List of content statuses. Valid values and what each value indicates are described in the following list:
|
||
Vector, elements of type category |
||
Internal ID that was assigned by Content Delivery Server to the subscriber account. |
||
Period of time covered by a subscription. Valid values are daily, weekly, monthly, and yearly. |
||
Internal object used to validate that the subscriber can access the content requested. |
||
Number of times the content can be used for free before the subscriber is prompted to purchase. |
||
User agent for a device. This string is the exact string that was returned in the HTTP header. |
||
User agent for a device. This string is a regular expression, which is a pattern that can match various text strings. |
||
Vector, elements of type preview |
List of preview files targeted for WAP browsers. If no preview files are targeted for WAP browsers, an empty list is returned. |
|
Flag that indicates that the content was sent to the device using SMS. True indicates that SMS was used. False indicates that SMS was not used. |
||
Vector, elements of type preview |
List of preview files targeted for web browsers. If no preview files are targeted for web browsers, an empty list is returned. |
This section presents two examples of using the XML-RPC implementation of the Subscriber API.
The following code excerpt shows how to create an API Context object. This sample uses the bindings for the Java programming language.
The following code excerpt shows how to create a handler and use that handler to purchase content. This sample uses the bindings for the Java programming language.
Copyright © 2008, Sun Microsystems, Inc. All Rights Reserved.