Premium subscription

Method: free subscription list

Authorization is required. Root group administrator privilege required.

Request

HTTP request

GET https://<YOUR_DOMAIN>/api/v1/en_US/premium/subscription/free/list?offset={offset}&pageSize={pageSize}&group={groupId}&premiumPackage={premiumPackage}&filter={filter}&target={target}&status={status}

Parameters

propertyvaluedescription
offset integer Needed for the infinite scroll functionality. It is the ID of the last presented item to the user. After the request list is generated the system will skip all records from the beginning up to the record with the provided ID (including it). The next batch of records will be returned in the response.
pageSize integer How many records to be returned by the system. Usually 15
group guid The id of a group for which the access privilege should apply
premiumPackage guid The id of the premium package for which the user has applied
filter string Query string to be looked for when filtering the records
target string Where should the filter look in. The alternatives are:
  • name - the name of the applicant
  • email - the email of the applicant
status integer What should be the subscription status. Alternatives are:
  • 1 - Pending
  • 2 - Accepted
  • 3 - Denied
  • 4 - Deleted

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": "Commodo enim pariatur ad enim ex et commodo consequat et cillum tempor minim.",
  "timestamp": "2014-03-03T23:20:23Z",
  "errors": [],
  "object": {
    "offset": "92653ebd-d0fe-4972-a941-71187eaa7013",
    "subscriptions": [
      {
        "id": "4c59ab31-f641-4f8d-8539-07a689abbd5d",
        "type": "premiumSubscription",
        "user": {
          "id": "e764eb1e-9dce-4cd8-bdee-7bc017a9ceb5",
          "alias": "dolore aliqua",
          "extendedAlias": "deserunt ad cupidatat mollit reprehenderit",
          "slug": "Home",
          "avatarUrl": "http://demo.hivesocialnow.com/bigavatar/bc7fbf51-7930-4550-98b0-6a3ff6111ebe.jpg",
          "url": "http://demo.hivesocialnow.com/blog/GeorgiRaykov/site/profile/"
        },
        "package": {
          "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
          "typeId": 2,
          "typeName": "Premium package with payment",
          "name": "3.Gold Membership",
          "isEnabled": true
        },
        "statusId": 2,
        "statusName": "Accepted",
        "createdOn": "2014-03-03T23:20:23Z",
        "modifiedOn": "2014-03-03T23:20:23Z",
        "modifiedBy": {
          "id": "e42eb707-5095-441d-9ffa-ceae4ba29d6c",
          "alias": "culpa ex",
          "extendedAlias": "cupidatat ad minim labore eu",
          "slug": "Home",
          "avatarUrl": "http://demo.hivesocialnow.com/bigavatar/bc7fbf51-7930-4550-98b0-6a3ff6111ebe.jpg",
          "url": "http://demo.hivesocialnow.com/blog/GeorgiRaykov/site/profile/"
        },
        "periodTypeId": 1,
        "periodTypeName": "Days",
        "periodCount": 22,
        "expiresOn": "2014-03-03T23:20:23Z",
        "terminatedOn": "2014-03-03T23:20:23Z",
        "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 integer The free premium subscription Id
user object Some common properties of the user that requested the subscription: id, alias, extendedAlias, slug, avatarUrl, url (of the profile page)
package object The selected premium package
statusId integer The subscription status. Alternatives are:
  • 1 - Pending
  • 2 - Accepted
  • 3 - Denied
  • 4 - Deleted
statusName string Human readable label of the status
createdOn date The creation date and time of the subscription in ISO 8601 format and UTC time zone
modifiedOn date The date and time of the last subscription modification or status change in ISO 8601 format and UTC time zone
modifiedBy object Some common properties of the user that modified the subscription: id, alias, extendedAlias, slug, avatarUrl, url (of the profile page)
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.
expiresOn date The date and time when the subscription will expire in ISO 8601 format and UTC time zone
terminatedOn date The date and time when the subscription was forcefully terminated in ISO 8601 format and UTC time zone
groups list (object) For which group this subscription will provide access to based on the selected premium package

Method: free subscription update

Authorization is required.

Request

HTTP request

PUT https://<YOUR_DOMAIN>/api/v1/en_US/premium/subscription/free/{itemId}

Parameters

propertyvaluedescription
itemId guid In id of the updated record

Request body

propertyvaluedescription
statusId integer The new status of the subscription. The alternatives are:
  • 1 - Pending
  • 2 - Accepted
  • 3 - Denied
  • 4 - Deleted

Response

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

{
  "timestamp": "2014-03-03T23:20:23Z",
  "success": true,
  "message": "Aliqua anim consequat amet cupidatat proident amet amet.",
  "errors": [],
  "object": {
    "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
    "type": "premiumSubscription",
    "user": {
      "id": "6b05b94e-e7c6-4bab-9377-e89ae1651425",
      "alias": "labore labore",
      "extendedAlias": "aute commodo eiusmod nisi labore",
      "slug": "Home",
      "avatarUrl": "http://demo.hivesocialnow.com/bigavatar/bc7fbf51-7930-4550-98b0-6a3ff6111ebe.jpg",
      "url": "http://demo.hivesocialnow.com/blog/GeorgiRaykov/site/profile/"
    },
    "package": {
      "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
      "typeId": 2,
      "typeName": "Premium package with payment",
      "name": "3.Gold Membership",
      "isEnabled": true
    },
    "statusId": 1,
    "statusName": "Pending",
    "modifiedOn": "2014-03-03T23:20:23Z",
    "modifiedBy": {
      "id": "6b05b94e-e7c6-4bab-9377-e89ae1651425",
      "alias": "labore labore",
      "extendedAlias": "aute commodo eiusmod nisi labore",
      "slug": "Home",
      "avatarUrl": "http://demo.hivesocialnow.com/bigavatar/bc7fbf51-7930-4550-98b0-6a3ff6111ebe.jpg",
      "url": "http://demo.hivesocialnow.com/blog/GeorgiRaykov/site/profile/"
    },
    "periodTypeId": 1,
    "periodTypeName": "Days",
    "periodCount": 22,
    "createdOn": "2014-03-03T23:20:23Z",
    "expiresOn": "2014-03-03T23:20:23Z",
    "terminatedOn": "2014-03-03T23:20:23Z",
    "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
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 the updated object. 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.

Method: delete free subscription

Authorization is required. This will mark the subscription as deleted. It will be still available for information until it is purged.

Request

HTTP request

DELETE https://<YOUR_DOMAIN>/api/v1/en_US/premium/subscription/free/{itemId}

Parameters

propertyvaluedescription
itemId guid In id of the deleted record

Request body

Do not supply a request body with this method.

Response

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

{
  "timestamp": "2014-03-03T23:20:23Z",
  "success": true,
  "message": "Aliqua anim consequat amet cupidatat proident amet amet.",
  "errors": [],
  "object": {
    "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
    "type": "premiumSubscription",
    "user": {
      "id": "6b05b94e-e7c6-4bab-9377-e89ae1651425",
      "alias": "labore labore",
      "extendedAlias": "aute commodo eiusmod nisi labore",
      "slug": "Home",
      "avatarUrl": "http://demo.hivesocialnow.com/bigavatar/bc7fbf51-7930-4550-98b0-6a3ff6111ebe.jpg",
      "url": "http://demo.hivesocialnow.com/blog/GeorgiRaykov/site/profile/"
    },
    "package": {
      "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
      "typeId": 2,
      "typeName": "Premium package with payment",
      "name": "3.Gold Membership",
      "isEnabled": true
    },
    "statusId": 1,
    "statusName": "Pending",
    "modifiedOn": "2014-03-03T23:20:23Z",
    "modifiedBy": {
      "id": "6b05b94e-e7c6-4bab-9377-e89ae1651425",
      "alias": "labore labore",
      "extendedAlias": "aute commodo eiusmod nisi labore",
      "slug": "Home",
      "avatarUrl": "http://demo.hivesocialnow.com/bigavatar/bc7fbf51-7930-4550-98b0-6a3ff6111ebe.jpg",
      "url": "http://demo.hivesocialnow.com/blog/GeorgiRaykov/site/profile/"
    },
    "periodTypeId": 1,
    "periodTypeName": "Days",
    "periodCount": 22,
    "createdOn": "2014-03-03T23:20:23Z",
    "expiresOn": "2014-03-03T23:20:23Z",
    "terminatedOn": "2014-03-03T23:20:23Z",
    "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
success Boolean Whether the requested operation is successful or not
message String Human readable error information
errors List (object) This list very rarely contains records during delete method processing
object object The object that was deleted

Method: purge free subscriptions

Authorization is required. Purges all subscription that are marked as deleted beforehand.

Request

HTTP request

POST https://<YOUR_DOMAIN>/api/v1/en_US/premium/subscription/free/purge

Parameters

Do not supply a request parameters with this method.

Request body

Do not supply a request body with this method.

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":[],
	"object": {}
}

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

Method: paid subscription list

Authorization is required. Root group administrator privilege required.

Request

HTTP request

GET https://<YOUR_DOMAIN>/api/v1/en_US/premium/subscription/paid/list?offset={offset}&pageSize={pageSize}&group={groupId}&premiumPackage={premiumPackage}&filter={filter}&target={target}

Parameters

propertyvaluedescription
offset integer Needed for the infinite scroll functionality. It is the ID of the last presented item to the user. After the request list is generated the system will skip all records from the beginning up to the record with the provided ID (including it). The next batch of records will be returned in the response.
pageSize integer How many records to be returned by the system. Usually 15
group guid The id of a group for which the access privilege should apply
premiumPackage guid The id of the premium package for which the user has applied
filter string Query string to be looked for when filtering the records
target string Where should the filter look in. The alternatives are:
  • name - the name of the applicant
  • email - the email of the applicant

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": "Elit exercitation amet ea non consectetur elit.",
  "timestamp": "2014-03-03T23:20:23Z",
  "errors": [],
  "object": {
    "offset": "ca937343-4cbb-44f1-9543-4cbacbbff117",
    "subscriptions": [
      {
        "id": "d3e6ceae-5fe2-48d1-9708-3862c51bcd8d",
        "type": "premiumSubscription",
        "user": {
          "id": "55745c80-2333-4a97-89d5-9b8faf3566bd",
          "alias": "ad do",
          "extendedAlias": "non sint quis pariatur minim",
          "slug": "Home",
          "avatarUrl": "http://demo.hivesocialnow.com/bigavatar/bc7fbf51-7930-4550-98b0-6a3ff6111ebe.jpg",
          "url": "http://demo.hivesocialnow.com/blog/GeorgiRaykov/site/profile/"
        },
        "package": {
          "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
          "typeId": 2,
          "typeName": "Premium package with payment",
          "name": "3.Gold Membership",
          "isEnabled": true
        },
        "createdOn": "2014-03-03T23:20:23Z",
        "trialPeriodTypeId": 2,
        "trialPeriodTypeName": "Week(s)",
        "trialPeriodCount": null,
        "trialPaymentAmmount": 333,
        "trialPaymentCurrency": "USD",
        "periodTypeId": 1,
        "periodTypeName": "Days",
        "periodCount": 22,
        "periodRecurring": 10,
        "paymentAmmount": 334,
        "paymentCurrency": "USD",
        "expiresOn": "2014-03-03T23:20:23Z",
        "terminatedOn": "2014-03-03T23:20:23Z",
        "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/"
          }
        ],
        "transactions": [
          {
            "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F9833D",
            "typeId": 4,
            "typeName": "Subscription payment",
            "paypalId": "6CT291114H7340203",
            "createdOn": "2014-03-03T23:20:23Z",
            "email": "test@domain.com",
            "amount": 49.95,
            "currency": "USD"
          },
          {
            "id": "3BCB2CD8-9A58-41F8-B1D1-0811F5F98331",
            "typeId": 4,
            "typeName": "Subscription payment",
            "paypalId": "6CT291114H7340203",
            "createdOn": "2014-03-03T23:20:23Z",
            "email": "test@domain.com",
            "amount": 49.95,
            "currency": "USD"
          }
        ],
        "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 integer The free premium subscription Id
user object Some common properties of the user that requested the subscription: id, alias, extendedAlias, slug, avatarUrl, url (of the profile page)
package object The selected premium package
createdOn date The creation date and time of the subscription in ISO 8601 format and UTC time zone
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 string How many money the trial period should cost. Supply the "0" string for a free trial. It needs to be string in order to submit also decimals
trialPaymentCurrency string The currency abbreviation of the trial payment
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 payment period should recur. Each period will require payment
paymentAmmount string How many money the subscription period should cost. Supply the "0" string for a free subscription
paymentCurrency string The currency abbreviation of the subscription payment
expiresOn date The date and time when the subscription will expire in ISO 8601 format and UTC time zone
terminatedOn date The date and time when the subscription was forcefully terminated in ISO 8601 format and UTC time zone
groups list (object) For which group this subscription will provide access to based on the selected premium package
transactions list (object) The details for each transaction

Method: evaluate import csv

Authorization is required. Imports subscriptions for some of the free premium packages. Can be executed only by root group administrators. Evaluates a csv file prepared for import and in the format: email (only). New line for record separator. No column headings.

Request

HTTP request

POST https://<YOUR_DOMAIN>/api/v1/en_US/premium/subscription/free/{packageId}/evaluate-import

Parameters

propertyvaluedescription
packageId guid In id of the premium package that you need to subscribe the imported emails/accounts to. Should be a free premium package

Request body

propertyvaluedescription
csvPath string Url to the CSV file that needs to be evaluated. The file should be in the format: email (only). New line for record separator. No column headings.

Response

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

{
  "success": true,
  "message": "Qui Lorem velit laborum aute duis sunt.",
  "timestamp": "2014-03-03T23:20:23Z",
  "errors": [
    {
      "key": "csvPath",
      "value": "http://demo.hivesocialnow.com/ClientFiles/bc7fbf51-7930-4550-98b0-6a3ff6111ebe/users.csv",
      "message": "The csv file is with wrong format"
    }
  ],
  "object": {
    "input": {
      "csvPath": "http://demo.hivesocialnow.com/ClientFiles/bc7fbf51-7930-4550-98b0-6a3ff6111ebe/users.csv"
    },
    "output": [
      {
        "type": "premiumPackageImportRow",
        "email": "lottrobinson@isoplex.com",
        "resultId": 1,
        "resultName": "New subscriber"
      },
      {
        "type": "premiumPackageImportRow",
        "email": "besn@isoplex.com",
        "resultId": 2,
        "resultName": "Registered email"
      },
      {
        "type": "premiumPackageImportRow",
        "email": "office@isoplex.com",
        "resultId": 3,
        "resultName": "Already subscribed"
      },
      {
        "type": "premiumPackageImportRow",
        "email": "mary@isoplex.com11",
        "resultId": 4,
        "resultName": "Invalid email"
      }
    ]
  }
}

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

propertyvaluedescription
input object Has a csvPath property, which is the provided for evaluation URL of the CSV file.
output List (object) List of the CSV file records but evaluated and with provided possible result of the import. The most important property of these objects is the resultId. It alternates as follows:
  • 1 - New subscriber - Record will be imported as a new subscriber of this premium package
  • 2 - Already subscribed - Not processed! This email is associated with an already active subscription
  • 3 - No such user - Not processed! This email is not related to a registered user
  • 4 - Invalid email - Not processed! The email is not in a valid format

Method: bulk import

Authorization is required. Can be executed only by root group administrators. Bulk imports a list of records as package subscribers.

Request

HTTP request

POST https://<YOUR_DOMAIN>/api/v1/en_US/premium/subscription/free/{packageId}/bulk-import

Parameters

propertyvaluedescription
packageId integer In id of the premium package. Should be a free premium package.

Request body

propertyvaluedescription
records List (object) List of record objects scheduled for import. The record object properties are:
  • email - subscriber email

Response

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

{
    "success": false,
    "message": "Qui Lorem velit laborum aute duis sunt.",
    "timestamp": "2014-03-03T23:20:23Z",
    "errors": [
		{
		"key":"",
		"value":"",
		"message": "System error occured"
		}],
    "object": {

    }
}

The general response properties are described on the Response format page.