api:employeesubscription:list
Table of Contents
API : Employee Subscriptions List
Introduction
This request will return the list of employee subscriptions that employees can subscribe to. They can either be global or limited to the customer of a given reseller.
The subscriptions are usually fetched when showing an employee, so that the subscriptions the employee has may be shown.
This request allows for returning:
- Subscriptions that employees of a given customer may subscribe to
- Subscriptions that belongs to a reseller
- All subscriptions (if the current user is a reseller admin or admin)
Request
| URL | https://api.telecomx.dk/employeeSubscription | |
|---|---|---|
| Method | GET | |
| Access level | PERSONAL, VIEWER, MANAGER, OWNER, RESELLER, RESELLER_ADMIN, ADMIN. | |
| Query | customer | [optional] Id of the customer for which employees the subscriptions must be available for. |
| reseller | [optional] Id of the reseller that the subscriptions must belong to. Ignored when customer is also given. |
|
| common | [optional] True if only common subscriptions (those that everybody can subscribe to) should be returned. Only honored for RESELLER_ADMIN/ADMIN callers, ignored for others. |
|
If neither customer or reseller is given, then RESELLER_ADMIN/ADMIN callers receive the complete list, while other callers receive the common subscriptions plus those of their own reseller.
Query examples
https://api.telecomx.dk/employeeSubscription?customer=650000000000000000000004 https://api.telecomx.dk/employeeSubscription?reseller=650000000000000000000003 https://api.telecomx.dk/employeeSubscription?common=true https://api.telecomx.dk/employeeSubscription
Response
| Array of JSON object | ||
|---|---|---|
| _id | Id | Unique employee subscription id. |
| reseller | Id | Id of the reseller the subscription belongs to. Null for common subscriptions. |
| title | String | Name of the subscription. |
| description | String | A longer description of what the subscription offers. |
| Boolean | True if subscribers will be notified by e-mail. | |
| sms | Boolean | True if subscribers will be notified by SMS. |
Note that properties holding no value may be omitted from the object.
Example
[ { "_id": "650000000000000000000001", "reseller": null, "title": "Planned service windows", "description": "When ever we need to perform upgrades that may affect your services, we send out an announcement 14 days in advance. Subscribe to this to get notified.", "email": true, "sms": false }, { "_id": "650000000000000000000002", "reseller": "650000000000000000000003", "title": "Newsletter", "description": "Monthly product news from your reseller.", "email": true, "sms": true } ]
Errors
| Error code | Message | Description |
|---|---|---|
| 422 | customer | Customer id is not valid |
| 422 | reseller | Reseller id is not valid |
| 422 | common | Not a valid boolean value |
| 404 | customer | Customer not found |
| 403 | access_denied | Insufficient access level |
| 500 | internal_error | <Unspecified> |
api/employeesubscription/list.txt · Last modified: by Mikkel Meerwaldt Jørgensen