Subscriptions Object REST

Skip to end of metadata
Go to start of metadata

Lite Registration is a premium product that requires separate activation. For inquiries, contact your Account Manager by filling a support form. You can access the support page by clicking Support on the upper menu after logging into your Gigya Console.

Description

When implementing Subscription Management, the Subscription Object is used to pass information regarding a user's subscription status to a specific newsletter or service. The structure of the Subscriptions Object is as follows, where the available fields are listed below: 

subscriptions.<subscriptionID>.email.<field>

Where <subscriptionID> is the name of this subscription in your site's schema.

Subscriptions Object Data Members

FieldTypeDescription
<subscriptionID>JSON objectIncludes the email object, below.

 

Email Object Data Members

FieldTypeDescription
isSubscribedBooleanThe status of the user's subscription to this service. Note that even when a subscription requires double opt-in, the value of the isSubscribed parameter changes immediately when the subscriber submits their subscription (e.g. flags a checkbox in a Gigya screen and clicks "Submit"), and before the email confirmation.
tagsarray of stringsAn array of tags that you can define which are associated with the subscription.
lastUpdatedSubscriptionStatestringThe time when the isSubscribed value was last changed in ISO 8601 format, e.g., "2017-07-16T19:20:30Z". Note that even when a subscription requires double opt-in, the value of the isSubscribed parameter changes immediately when the subscriber submits their subscription (e.g. flags a checkbox in a Gigya screen and clicks "Submit"), and before the email confirmation.
doubleOptInJSON object

Whether or not the subscription requires double opt-in, it contains a double opt-in object with the following fields:

  • emailSentTime (string): The time at which the latest confirmation email was sent to the subscriber.
  • confirmTime (string): The time at which the subscriber confirmed the subscription. If the user has not confirmed (or double opt-in is not required for this subscription), this will be set to "null".
  • status (string): The confirmation status. Returns one of the following values:
    • Pending - The user subscribed but has not yet confirmed their subscription.
    • NotConfirmed - Double opt-in is not required, the user has never subscribed, or the user has unsubscribed, before or after confirmation.
    • Confirmed - The user has confirmed their subscription.

 

Response Example

"subscriptions": {
	"test2sub": {
		"email": {
			"tags": [
				"social_user",
				"pet_dog"
			],
        	"lastUpdatedSubscriptionState": "2017-05-15T11:30:05.555Z",
			"isSubscribed": true
			"doubleOptIn":
    	    {
       		 "emailSentTime": "2017-07-07T19:20:30Z",
      	     "confirmTime": "2017-07-07T20:00:00Z",
	         "status": "Confirmed" 
        	}
        }
    }
}

 

Nested Subscriptions

You can create a nested set of subscriptions by using a namespace when defining the subscriptionID to categorize different groups of subscriptions.

Below is an example response of nested subscriptions:

"subscriptions": {
	"petOwnerNewsletters.canineNewsletter": {
		"email": {
			"tags": [
				"social_user",
				"pets_dog"
			],
        	"lastUpdatedSubscriptionState": "2017-05-15T11:30:05.555Z",
			"isSubscribed": false,
			"doubleOptIn":
    	    {
       		 "emailSentTime": "2017-09-14T16:26:13.3607548Z",
      	     "confirmTime": null,
	         "status": "Pending" 
        	}
        }
    },
	"petOwnerNewsletters.felineNewsletter": {
		"email": {
			"tags": [
				"social_user",
				"pets_cat"
			],
        	"lastUpdatedSubscriptionState": "2017-05-15T11:30:05.555Z",
			"isSubscribed": true,
			"doubleOptIn":
    	    {
       		 "emailSentTime": "2017-09-09T12:22:30Z",
      	     "confirmTime": "2017-09-09T15:05:00Z",
	         "status": "Confirmed" 
        	}
        }
    },
	"petOwnerNewsletters.avianNewsletter": {
		"email": {
			"tags": [
				"social_user",
				"pets_bird"
			],
        	"lastUpdatedSubscriptionState": "2017-05-15T11:30:05.555Z",
			"isSubscribed": true,
			"doubleOptIn":
    	    {
       		 "emailSentTime": null,
      	     "confirmTime": null,
	         "status": "NotConfirmed" 
        	}
        }
    }
}

 

Searching Subscriptions

See Querying Subscription Data.

 

Additional Information

accounts.setSchema

 

  • No labels