Premium package

The premium package in HiveSocial can manage the access to the groups' content that are subscribed to it. People can get the premium package for free (after an approval) or by paying through Paypal.

Method: list

Authorization is required. Can be executed only by root group administrators

Request

HTTP request

GET https://<YOUR_DOMAIN>/api/v1/en_US/premium/package/list?group={groupId}

Parameters

propertyvaluedescription
groupId guid The method will return all premium packages, but will set the objects' "isEnabled" and "isVisible" properties based on the group you have provided.

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response JSON with the following structure:

{
  "success": true,
  "message": "Esse anim incididunt duis nostrud veniam nisi ut non in duis dolor cupidatat enim.",
  "timestamp": "2014-03-03T23:20:23Z",
  "errors": [],
  "object": {
    "offset": 0,
    "packages": [
      {
        "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
        "type": "premiumPackage",
        "typeId": 2,
        "typeName": "Premium package with payment and managed approval",
        "name": "3.Gold Membership",
        "description": "<ul><li>Access to this</li><li>Access to that</li><li>Some good stuff </li><li>2 months</li><li>20 USD/monthly </li><li>Bonus </li><li>Bonus</li></ul>",
        "trialPeriodTypeId": 2,
        "trialPeriodTypeName": "Week(s)",
        "trialPeriodCount": 22,
        "trialPaymentAmmount": 333,
        "trialPaymentCurrency": "USD",
        "periodTypeId": 1,
        "periodTypeName": "Days",
        "periodCount": 22,
        "periodRecurring": 10,
        "paymentAmmount": 333,
        "paymentCurrency": "USD",
        "isEnabled": true,
        "isVisible": true,
        "hideButtons": false,
        "position": 1,
        "groups": [
          {
            "id": "50b88e09-141a-4a2e-811c-d7e086910951",
            "name": "home",
            "slug": "Home",
            "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
            "url": "http://demo.hivesocialnow.com/Home/"
          },
          {
            "id": "50b88e09-141a-4a2e-811c-d7e086910952",
            "name": "premium-sub",
            "slug": "PremiumSub",
            "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
            "url": "http://demo.hivesocialnow.com/premium-sub/"
          }
        ],
        "accessWarnings": []
      }
    ]
  }
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

propertyvaluedescription
id guid Id of the premium package
typeId integer What is the premium package type. The alternatives are:
  • 1 - Managed Premium package
  • 2 - Premium package with payment
  • 3 - Premium package with payment and managed approval
typeName string The human readable package type, based on the options above.
name string the package name
description string Describes the package to the public.
trialPeriodTypeId string What is the trial period type. Options are:
  • 1 - day(s)
  • 2 - week(s)
  • 3 - month(s)
  • 4 - year(s)
trialPeriodTypeName string The human readable name of the trial period.
trialPeriodCount integer How many periods from the set type will be the trial period duration.
trialPaymentAmmount integer What is the payment amount for the trail period. Fill 0 for free.
trialPaymentCurrency string The currency abbreviation.
periodTypeId string What is the subscription period type. Options are:
  • 1 - day(s)
  • 2 - week(s)
  • 3 - month(s)
  • 4 - year(s)
periodTypeName string The human readable name of the subscription period.
periodCount integer How many periods from the set type will be the subscription period duration.
periodRecurring integer How many times the subscription period must repeat before the subscription to expire. Fill 0 for unlimited recurrence
paymentAmmount integer What is the payment amount for the subscription period. Fill 0 for free.
paymentCurrency string The currency abbreviation.
isEnabled boolean Is this package enabled. If disabled, this package will stop providing access for its subscribers
isVisible boolean Is this package visible in the packages list. Even if the package is not visible in the list, it will keep providing access to the users that have already subscribed to it.
hideButtons boolean Hide the buttons in the package view control on the public site.
position integer The package position in the list.
groups list (object) Which groups are subscribed for this package.

Method: get

Authorization is required. Can be executed only by root group administrators

Request

HTTP request

GET https://<YOUR_DOMAIN>/api/v1/en_US/premium/package/{packageId}

Parameters

propertyvaluedescription
packageId guid The premium package's ID

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response JSON with the following structure:

{
  "success": true,
  "message": "Nisi proident tempor cillum sint duis eu elit dolor Lorem amet qui officia occaecat.",
  "timestamp": "2014-03-03T23:20:23Z",
  "errors": [],
  "object": {
    "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
    "type": "premiumPackage",
    "typeId": 2,
    "typeName": "Premium package with payment",
    "name": "3.Gold Membership",
    "description": "some description here",
    "trialPeriodTypeId": 2,
    "trialPeriodTypeName": "Week(s)",
    "trialPeriodCount": 23,
    "trialPaymentAmmount": 333,
    "trialPaymentCurrency": "USD",
    "periodTypeId": 1,
    "periodTypeName": "Days",
    "periodCount": 22,
    "periodRecurring": 10,
    "paymentAmmount": 334,
    "paymentCurrency": "USD",
    "isEnabled": true,
    "isVisible": true,
    "hideButtons": true,
    "position": 1,
    "groups": [
      {
        "id": "50b88e09-141a-4a2e-811c-d7e086910951",
        "name": "home",
        "slug": "Home",
        "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
        "url": "http://demo.hivesocialnow.com/Home/"
      },
      {
        "id": "4bdf61a1-9021-46fe-bf92-cfb4026ab4f2",
        "name": "private-sub",
        "slug": "PrivateSub",
        "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
        "url": "http://demo.hivesocialnow.com/premium-sub/"
      }
    ],
    "accessWarnings": []
  }
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

propertyvaluedescription
id guid Id of the premium package
typeId integer What is the premium package type. The alternatives are:
  • 1 - Managed Premium package
  • 2 - Premium package with payment
  • 3 - Premium package with payment and managed approval
typeName string The human readable package type, based on the options above.
name string the package name
description string Describes the package to the public.
trialPeriodTypeId string What is the trial period type. Options are:
  • 1 - day(s)
  • 2 - week(s)
  • 3 - month(s)
  • 4 - year(s)
trialPeriodTypeName string The human readable name of the trial period.
trialPeriodCount integer How many periods from the set type will be the trial period duration.
trialPaymentAmmount integer What is the payment amount for the trail period. Fill 0 for free.
trialPaymentCurrency string The currency abbreviation.
periodTypeId string What is the subscription period type. Options are:
  • 1 - day(s)
  • 2 - week(s)
  • 3 - month(s)
  • 4 - year(s)
periodTypeName string The human readable name of the subscription period.
periodCount integer How many periods from the set type will be the subscription period duration.
periodRecurring integer How many times the subscription period must repeat before the subscription to expire. Fill 0 for unlimited recurrence
paymentAmmount integer What is the payment amount for the subscription period. Fill 0 for free.
paymentCurrency string The currency abbreviation.
isEnabled boolean Is this package enabled. If disabled, this package will stop providing access for its subscribers
isVisible boolean Is this package visible in the packages list. Even if the package is not visible in the list, it will keep providing access to the users that have already subscribed to it.
hideButtons boolean Hide the buttons in the package view control on the public site.
position integer The package position in the list.
groups list (object) Which groups are subscribed for this package.

Method: create

Authorization is required. Can be executed only by root group administrators

Request

HTTP request

POST https://<YOUR_DOMAIN>/api/v1/en_US/premium/package

Parameters

Do not supply a request parameters with this method.

Request body

propertyvaluedescription
typeId integer What is the premium package type. The alternatives are:
  • 1 - Managed Premium package
  • 2 - Premium package with payment
  • 3 - Premium package with payment and managed approval
name string the package name
description string Describes the package to the public.
trialPeriodTypeId string What is the trial period type. Options are:
  • 1 - day(s)
  • 2 - week(s)
  • 3 - month(s)
  • 4 - year(s)
trialPeriodCount integer How many periods from the set type will be the trial period duration.
trialPaymentAmmount integer What is the payment amount for the trail period. Fill 0 for free.
periodTypeId string What is the subscription period type. Options are:
  • 1 - day(s)
  • 2 - week(s)
  • 3 - month(s)
  • 4 - year(s)
periodCount integer How many periods from the set type will be the subscription period duration.
periodRecurring integer How many times the subscription period must repeat before the subscription to expire. Fill 0 for unlimited recurrence
paymentAmmount integer What is the payment amount for the subscription period. Fill 0 for free.
isEnabled boolean Is this package enabled. If disabled, this package will stop providing access for its subscribers
isVisible boolean Is this package visible in the packages list. Even if the package is not visible in the list, it will keep providing access to the users that have already subscribed to it.
hideButtons boolean Hide the buttons in the package view control on the public site.
position integer The package position in the list. It will be inserted into this position.
groups list (object) Which groups are subscribed for this package. Should be a guid list of group Ids

Response

If successful, this method returns a response JSON with the following structure:

{
  "timestamp": "2014-03-03T23:20:23Z",
  "success": false,
  "message": "Aliqua anim consequat amet cupidatat proident amet amet.",
  "errors": [
    {
      "key": "title",
      "value": "",
      "message": "title cannot be blank"
    }
  ],
  "object": {
    "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
    "type": "premiumPackage",
    "typeId": 2,
    "typeName": "Premium package with payment",
    "name": "3.Gold Membership",
    "description": "some description",
    "trialPeriodTypeId": 2,
    "trialPeriodTypeName": "Week(s)",
    "trialPeriodCount": 22,
    "trialPaymentAmmount": 333,
    "trialPaymentCurrency": "USD",
    "periodTypeId": 1,
    "periodTypeName": "Days",
    "periodCount": 22,
    "periodRecurring": 10,
    "paymentAmmount": 333,
    "paymentCurrency": "USD",
    "isEnabled": true,
    "isVisible": true,
    "hideButtons": false,
    "position": 1,
    "groups": [
      {
        "id": "50b88e09-141a-4a2e-811c-d7e086910951",
        "name": "home",
        "slug": "Home",
        "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
        "url": "http://demo.hivesocialnow.com/Home/"
      }
    ],
    "accessWarnings": []
  }
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

propertyvaluedescription
success Boolean Whether the requested operation is successful or not
message String Human readable error information
errors List (object) List of validation errors, if any. The "key" property value is matched to one of the record's fields
object object The object that caused the validation errors or that was created. Have in mind that, if the server requires string trimming or data manipulation after the user submission, it is applied in this object. In this way the returned object can differ from the posted one.

Method: update

Authorization is required. Can be executed only by root group administrators

Request

HTTP request

PUT https://<YOUR_DOMAIN>/api/v1/en_US/premium/package/{packageId}

Parameters

propertyvaluedescription
packageId integer In id of the updated record

Request body

propertyvaluedescription
typeId integer What is the premium package type. The alternatives are:
  • 1 - Managed Premium package
  • 2 - Premium package with payment
  • 3 - Premium package with payment and managed approval
name string the package name
description string Describes the package to the public.
trialPeriodTypeId string What is the trial period type. Options are:
  • 1 - day(s)
  • 2 - week(s)
  • 3 - month(s)
  • 4 - year(s)
trialPeriodCount integer How many periods from the set type will be the trial period duration.
trialPaymentAmmount integer What is the payment amount for the trail period. Fill 0 for free.
periodTypeId string What is the subscription period type. Options are:
  • 1 - day(s)
  • 2 - week(s)
  • 3 - month(s)
  • 4 - year(s)
periodCount integer How many periods from the set type will be the subscription period duration.
periodRecurring integer How many times the subscription period must repeat before the subscription to expire. Fill 0 for unlimited recurrence
paymentAmmount integer What is the payment amount for the subscription period. Fill 0 for free.
isEnabled boolean Is this package enabled. If disabled, this package will stop providing access for its subscribers
isVisible boolean Is this package visible in the packages list. Even if the package is not visible in the list, it will keep providing access to the users that have already subscribed to it.
hideButtons boolean Hide the buttons in the package view control on the public site.
position integer The package position in the list. It will be inserted into this position.
groups list (object) Which groups are subscribed for this package. Should be a guid list of group Ids

Response

If successful, this method returns a response JSON with the following structure:

{
  "timestamp": "2014-03-03T23:20:23Z",
  "success": false,
  "message": "Aliqua anim consequat amet cupidatat proident amet amet.",
  "errors": [
    {
      "key": "title",
      "value": "",
      "message": "title cannot be blank"
    }
  ],
  "object": {
    "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
    "type": "premiumPackage",
    "typeId": 2,
    "typeName": "Premium package with payment",
    "name": "3.Gold Membership",
    "description": "some description",
    "trialPeriodTypeId": 2,
    "trialPeriodTypeName": "Week(s)",
    "trialPeriodCount": 22,
    "trialPaymentAmmount": 333,
    "trialPaymentCurrency": "USD",
    "periodTypeId": 1,
    "periodTypeName": "Days",
    "periodCount": 22,
    "periodRecurring": 10,
    "paymentAmmount": 333,
    "paymentCurrency": "USD",
    "isEnabled": true,
    "isVisible": true,
    "hideButtons": false,
    "position": 1,
    "groups": [
      {
        "id": "50b88e09-141a-4a2e-811c-d7e086910951",
        "name": "home",
        "slug": "Home",
        "thumbUrl": "http://demo.hivesocialnow.com/logo/72_635267855582630000.png",
        "url": "http://demo.hivesocialnow.com/Home/"
      }
    ],
    "accessWarnings": []
  }
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

propertyvaluedescription
success Boolean Whether the requested operation is successful or not
message String Human readable error information
errors List (object) List of validation errors, if any. The "key" property value is matched to one of the record's fields
object object The object that caused the validation errors or that was updated. Have in mind that, if the server requires string trimming or data manipulation after the user submission, it is applied in this object. In this way the returned object can differe from the posted one.