NativeSubscriptionManagerSubscriptionAddOrSave Method Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Adds or updates a subscription on a subscribable category.

Namespace: ContentStudio.Document.Subscription
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public Guid SubscriptionAddOrSave(
	ConnectionId connectionId,
	SessionId sessionId,
	Guid subscriptionDefinitionId,
	string subscriberName,
	string subscriberAddress,
	SubscriberAddressType subscriberAddressType,
	string externalMembershipProviderName,
	Object externalSubscriberIdentifier,
	bool allowUpdateOfExisting
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId). Anonymous subscriptions are supported, in that case, pass CS_ANONYMOUS_SESSION_IDENTIFIER.
subscriptionDefinitionId
Type: SystemGuid
The subscription definition id.
subscriberName
Type: SystemString
Name of the subscriber to add or update. This parameter cannot be null and cannot exceed MaxSubscriberNameDataLength characters in length.
subscriberAddress
Type: SystemString
The subscriber address. If this address exists the subscription will be update otherwise a new subscription will be added. This parameter cannot be null and cannot exceed MaxSubscriberAddressDataLength characters in length.
subscriberAddressType
Type: ContentStudio.Document.SubscriptionSubscriberAddressType
Type of the subscriber address.
externalMembershipProviderName
Type: SystemString
The name of the external membership provider used to verify this subscriber. This value can be null (Nothing in Visual Basic) if no MembershipProvider is used, but cannot exceed MaxSubscriberProviderDataLength characters in length.
externalSubscriberIdentifier
Type: SystemObject
An identifier to the users account in the the external membership provider used to verify this subscriber. This value can be null (Nothing in Visual Basic) if no MembershipProvider is used.
allowUpdateOfExisting
Type: SystemBoolean
Specifies whether the subscriberName, externalMembershipProviderName and externalSubscriberIdentifier will be updated if a subscription with the address specified already exists.

Return Value

Type: Guid
Guid that identifies the added or updated subscription.
Exceptions

ExceptionCondition
CSException
NumberDescription
1022The definition represented by the subscriptionDefinitionId parameter is not enabled for subscription.
1503The category does not exist, or the definition represented by the subscriptionDefinitionId parameter does not exist.
CSPermissionDeniedExceptionThe caller has no permission to perform the requested action
CSInvalidSessionExceptionThe session is invalid
NotSupportedExceptionThe value of subscriberAddressType parameter is not supported.
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

For Newsletter subscriptions, this method can successfully be executed by any authenticated or anonymous caller.
Remarks

Note Note
This method is new in Content Studio 5.2
See Also

Reference