---
title: "API: getUserSubscriptions"
slug: "api-getusersubscriptions"
tags: ["subscriptions"]
updated: 2022-09-20T15:48:49Z
published: 2022-09-20T15:48:49Z
canonical: "support.smarteru.com/api-getusersubscriptions"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.smarteru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API: getUserSubscriptions

- 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](/v1/docs/user-subscription-enrollments).

## Who Has Access

The following users have access to the getUserSubscriptions method:

- Users with the [Group Managers](/v1/docs/group-permission-group-manager-gm), [Manage Group Users](/v1/docs/group-permission-manage-group-users-mgu), or [Manage Users](/v1/docs/group-permission-manage-users-mu) group permission.
- [Administrators and owners](/v1/docs/user-profile-information#access-level).

## API Call XML Package

```markup
<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.

```markup
<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](/v1/docs/api-getusersubscriptions#email) and [EmployeeID](/v1/docs/api-getusersubscriptions#employeeid) tags. This is the ID returned by the [getUser](/v1/docs/api-getuser) and [listUsers](/v1/docs/api-listusers) methods.

### **Email**

The [user's email address](/v1/docs/user-login-information#primary-email-required-if-employee-id-not-specified). This tag us mutually exclusive with the [ID](/v1/docs/api-getusersubscriptions#id) and [EmployeeID](/v1/docs/api-getusersubscriptions#employeeid) tags. This is the Email returned by the [getUser](/v1/docs/api-getuser) and [listUsers](/v1/docs/api-listusers) methods.

### **EmployeeID**

The [user's employee ID](/v1/docs/user-login-information#employee-id-required-if-primary-email-not-specified). This tag is mutually exclusive with the [ID](/v1/docs/api-getusersubscriptions#id) and [Email](/v1/docs/api-getusersubscriptions#email) tags. This is the EmployeeID returned by the [getUser](/v1/docs/api-getuser) and [listUsers](/v1/docs/api-listusers) methods.

## API Response XML Package

The [API response XML package](/v1/docs/api-response-xml-package) will always include a Result, Info, and [Errors](/v1/docs/api-getusersubscriptions#error-codes) tag.

```markup
<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](/v1/docs/subscription-main#name-required).

### VariantName

The [variant's name](/v1/docs/variant-main#name-required).

### Duration

The [variant's duration](/v1/docs/variant-duration#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.

```markup
<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 Code | Message |
| --- | --- |
| 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. |

## Related

- [API: createUser](/api-createuser.md)
- [API: getUser](/api-getuser.md)
- [API: getUserGroups](/api-getusergroups.md)
- [API: getUserWithRoleDetail](/api-getuserwithroledetail.md)
- [API: listUsers](/api-listusers.md)
- [API: updateUser](/api-updateuser.md)
- [Enrolling Users](/enrolling-users.md)
- [Subscriptions](/subscriptions.md)
- [Users ](/users.md)
