API: getUserSubscriptions
  • 2 Minutes to read
  • Dark
    Light

API: getUserSubscriptions

  • Dark
    Light

  • Starting June 1, 2022, SmarterU will require all API calls to POST to HTTPS. Any POST to HTTP will result in the SU:01 error (i.e., No POST data detected.).
  • If you are viewing the help in a language other than English, please change your language to English before copying and pasting any code. All API attributes and functions are in English.
  • Tags are required unless specified.

Description

The getUserSubscriptions method retrieves a user's subscriptions.

Who Has Access

The following users have access to the getUserSubscriptions method:

API Call XML Package

<SmarterU>
   <AccountAPI><![CDATA[]]></AccountAPI>
   <UserAPI><![CDATA[]]></UserAPI>
   <Method>getUserSubscriptions</Method>
   <Parameters>
      <User>
         <ID><![CDATA[]]></ID>
            -OR-
         <Email><![CDATA[]]></Email>
            -OR-
         <EmployeeID><![CDATA[]]></EmployeeID>
      </User>
   </Parameters>
</SmarterU>

User Tag Group

The User tag group is a container for the user filter.

<User>
   <ID><![CDATA[]]></ID>
      -OR-
   <Email><![CDATA[]]></Email>
      -OR-
   <EmployeeID><![CDATA[]]></EmployeeID>
</User>

The User tag contains one of the following. 

ID

The user's system-generated identifier. This tag is mutually exclusive with the Email and EmployeeID tags. This is the ID returned by the getUser and listUsers methods.

Email

The user's email address. This tag us mutually exclusive with the ID and EmployeeID tags. This is the Email returned by the getUser and listUsers methods. 

EmployeeID

The user's employee ID. This tag is mutually exclusive with the ID and Email tags. This is the EmployeeID returned by the getUser and listUsers methods. 

API Response XML Package

The API response XML package will always include a Result, Info, and Errors tag.

<SmarterU>
   <Result></Result>
   <Info>
      <UserSubscriptions>
         <UserSubscription>
            <ID><![CDATA[]]></ID>
            <SubscriptionName><![CDATA[]]></SubscriptionName>
            <VariantName><![CDATA[]]></VariantName>
            <Duration><![CDATA[]]></Duration>
            <StartDate><![CDATA[]]></StartDate>
            <EndDate><![CDATA[]]></EndDate>
            <Expired><![CDATA[]]></Expired>
         </UserSubscription>
      </UserSubscriptions>
   </Info>

   <Errors>
      <Error>
         <ErrorID></ErrorID>
         <ErrorMessage></ErrorMessage>
      </Error>
   </Errors>
</SmarterU>

The UserSubscriptions tag is a container for the subscriptions returned by the getUserSubscriptions method. Each subscription is contained in a UserSubscription tag and may contain the following.

ID

The subscription's system-generated identifier.

SubscriptionName

The subscription's name.

VariantName

The variant's name.

Duration

The variant's duration.

StartDate

The date the user's subscription started.

EndDate

The date the user's subscription ends.

Expired

Indicates whether the user's subscription is expired:

  • 0 - The user's subscription is not expired.
  • 1 - The user's subscription is expired. 

Example API Response XML Package

Below is an example of an API response XML package.

<SmarterU>
   <Result>Success</Result>
   <Info>
      <UserSubscriptions>
         <UserSubscription>
            <ID>1669</ID>
            <SubscriptionName><![CDATA[Fina Shoes Advanced]]></SubscriptionName>
            <VariantName><![CDATA[14 Days]]></VariantName>
            <Duration>Days</Duration>
            <StartDate>2014-12-10 00:00:00.0</StartDate>
            <EndDate>2017-07-07 00:00:00.0</EndDate>
            <Expired>1</Expired>
         </UserSubscription>

         <UserSubscription>
            <ID>25930</ID>
            <SubscriptionName><![CDATA[Fina Shoes Trial]]></SubscriptionName>
            <VariantName><![CDATA[3 Day]]></VariantName>
            <Duration>Days</Duration>
            <StartDate>2016-03-07 19:48:10.0</StartDate>
            <EndDate>2016-03-10 19:48:10.0</EndDate>
            <Expired>1</Expired>
         </UserSubscription>

         <UserSubscription>
            <ID>31880</ID>
            <SubscriptionName><![CDATA[Fina Shoes Basics]]></SubscriptionName>
            <VariantName><![CDATA[45 Day]]></VariantName>
            <Duration>Days</Duration>
            <StartDate>2016-05-11 19:02:30.0</StartDate>
            <EndDate>2016-08-19 00:00:00.0</EndDate>
            <Expired>1</Expired>
         </UserSubscription>
      </UserSubscriptions>
   </Info>
   <Errors>

   </Errors>
</SmarterU>

Error Codes

Error CodeMessage
GUS:01
The email address provided is not valid.
GUS:02
The required permissions are not met to call the getUser method.
GUS:03
The user id provided is not valid.
GUS:04
The user requested does not exist.
GUS:05
The requested user cannot be retrieved via the API.

Was this article helpful?