
Subscription Operations
Subscriptions are configured for one or more locations in
NewsGator Online, so subscription operations are normally done with respect to a location.
XmlElement GetSubscriptionList(location, syncToken)
Returns the user's subscriptions, including the folder
hierarchy defined in NewsGator Online, for the named location (NOT location ID), using the syncToken as advice for
generating synchronization information on the server. The result of this call is an
OPML document with NewsGator extensions.
Subscription lists are also synchronized,
so the GetSubscriptions operation accepts a Sync Token as described above. The token is returned as an attribute of
the opml root element in the response. The response also contains information for each subscription in the outline that
indicates whether the client has already seen all the content in a feed and whether the feed has any unread items; this
is determined using the sync token. If a client has already seen all the content in a feed, the client does not need to make
a request to NewsGator Online for the synchronized feed; this saves bandwidth and download time for the client, so clients that use NewsGator Online
synchronized feeds should use the sync token.
Parameters
-
location
-
The location to get the subscription list for.
-
syncToken
-
A sync token returned from an earlier call to this method, or nothing.
XmlElement GetSubscriptionCounts(location)
Returns an OPML outline for the user's subscription list for the named location,
with a count of unread items in each subscription's outline.
Parameters
-
location
-
The name of the location doing the replace operation.
int AddSubscription(xmlUrl, folderId, cred, customTitle)
This call adds a subscription to the url given, adding it to
the specified folder and attaching credentials to the subscription. These
credentials are submitted to the server using the negotiated mechanisms
specified by RFC 2617 when NewsGator Online downloads the xmlUrl.
xmlUrl should point to a syndicated feed in RSS or Atom format.
Parameters
-
xmlUrl
-
The URL of a syndicated feed (in RSS or Atom format) that you want to subscribe to.
-
folderId
-
The ID of a folder in the My Feeds hierarchy to put the subscription in.
-
cred
-
A credential structure describing the authentication required to access xmlUrl. You can omit this parameter
for unsecured feeds. You may omit this parameter entirely if the xmlURl does not require authentication.
- customTitle
-
An alternate name for the feed, displayed in place of the name the
publisher has given the feed - applies to this user only. The caller should pass null in this parameter
to use the publisher's default.
- markRead
-
If true, marks all the posts in this feed read after subscribing. This is the equivalent of immediately calling Feed.asmx/MarkFeedRead on the result
of AddSubscription.
The credential structure is formally documented by the WSDL; the following
examples demonstrate uses of the credential structure:
-
Indicates that the xmlUrl uses the user's NewsGator credentials. This is valid
only for feeds that originate at http://services.newsgator.com, i.e. smart
feeds and premium feeds.
<cred xmlns="http://services.newsgator.com/svc/Subscription.asmx">
<useNGOSCredentials>true</useNGOSCredentials>
</cred>
-
Indicates that the user wants to authenticate xmlUrl with the username
"whomever" and the password "topsecret".
<cred xmlns="http://services.newsgator.com/svc/Subscription.asmx">
<networkCredential>
<username>whomever</username>
<passwordenc>topsecret</passwordenc>
</networkCredential>
</cred>
void
DeleteSubscriptions(int[] subscriptionList)
Deletes the subscriptions
identified in the argument from the currently authenticated user's subscription
list.
Parameters
-
subscriptionList
-
An array of subscription identifiers (as returned from the
AddSubscription call) that are to be deleted.
void RenameSubscription(subscriptionId, newName)
Sets a new name for the subscription. The new name appears as
the title attribute in the OPML for the subscription list.
Parameters
-
id
-
The identifier for the subscription to rename.
-
newName
-
The new name for the subscription.
void MoveSubscription(subscriptionId, toFolderId)
Moves a subscription to a specific folder in NewsGator Online.
Parameters
-
subscriptionId
-
The identifier for the subscription.
-
toFolderId
-
The id for the folder to place the subscription in. This identifier
must be located in the My Feeds hierarchy (0 means the root of My Feeds); the results of using an identifier from another hierarchy
are undefined.
XmlElement MergeSubscriptions(locationName, opmlDocument, markRead)
Merges a subscription list with the user's current subscription list.
Duplicate subscriptions will not be duplicated in NewsGator; however, duplicates are determined solely by URI equivalence
of the xmlurl attributesof individual <outline> elements and will not determine that, for example, two different
URIs resolve to the same content.
Parameters
-
locationName
-
The name of the location that is performing the merge.
-
opmlDocument
-
An OPML document rooted at the <opml> element representing
the subscription list to merge.
- markRead
- If true, mark all the feeds just added as read.
void ReplaceSubscriptions(locationName, opmlDocument)
Replaces a user's subscription list with the subscription list
given by the opmlDocument parameter.
Parameters
-
locationName
-
The name of the location doing the replace operation.
-
opmlDocument
-
An OPML document representing the subscription list to use as the user's
new subscription list.
String[] GetUpdates(locationName, syncToken, out newToken)
Gets a list of Feed IDs that have updated since the last sync.
Parameters
-
locationName
-
The name of the location to get subscriptions for.
-
syncToken
-
The syncToken returned from the last call to GetUpdates (or GetSubscriptionList)
newToken
-
(Output parameter) The token to use on the next call to GetUpdates (or GetSubscriptionList)
SOAP Endpoint