User Tools

Site Tools


api:employeesubscription:create

API : Employee Subscriptions Create

Introduction

This request will create a new employee subscription.

Request

URL https://api.telecomx.dk/employeeSubscription
Method POST
Access level RESELLER if creating a subscription for own customers
or ADMIN (who can create global subscriptions).
Body reseller Id Id of the reseller the subscription belongs to, null for global.
title String Name of the subscription.
description String [optional] A longer description of what the subscription offers.
email Boolean [optional] True if subscribers will be notified by e-mail.
sms Boolean [optional] True if subscribers will be notified by SMS.

Although email and sms is optional, one of them must be present.

Request body example

{
  reseller: '1234567890ABCDEF12345678',
  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
}

Response

The response will be the newly created employee subscription, if no errors occurred.

JSON object
_id Id Unique employee subscription id.
reseller Id Id of the reseller the subscription belongs to, if any.
title String Name of the subscription.
description String A longer description of what the subscription offers.
email 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: '123456780ABCDEF12345678',
  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
}

Errors

Error code Message Description
400 bad_request Employee subscription not found in body of request
422 title title is missing
422 email No transmission type set, at least email or sms must be selected
422 reseller Reseller is not valid
403 access_denied Insufficient access level
404 reseller Reseller not found
api/employeesubscription/create.txt · Last modified: 2014/06/04 07:22 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki