You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Управление серийными номерами на ПО происходит через заказы. 

Жизненный цикл заказа (статусы):

  • Draft (0) Черновик. Присваивается в момент создания заказа. В этом статусе заказ разрешено редактировать.
  • Submitted(1) Отправлен. Присваивается в момент подтверждения заказа. В этом статусе заказ редактировать запрещено.
  • Revoked (2) Аннулирован. 
  • Archived (2) В архиве. 

Типы заказов:

  • Sale(0) Новый заказ. В момент подтверждения заказа происходит генерация серийных номеров.
  • Update(1) Заказ на обновление лицензионных условий для серийного номера.

Флаг типа лицензии:

  • Программная (по умолчанию; isHardwareLicense = false);
  • Аппаратная (isHardwareLicense = true).

Запросы для работы с заказами:

Get a list of orders

Authorization is required. There are no input parameters.

GET /v1.0/orders

Для запроса доступна сортировка и пагинация. Доступные поля сортировки: number, submitdate. Значения параметров сортировки и пагинации по умолчанию: sortby=number&direction=asc&offset=0&limit=100.

Для запроса доступна фильтрацию по статусу заказа: Draft(0), Submit(1), Revoked(2). По умолчанию в запросе выдаются заказы с любыми статусами. Если необходимо выбрать заказы с определенными статусами - перечислите их через запятую в параметре запроса "status". Например, указав status=0,1 получите только заказы в статусе Draft(0) и Submit(1).

Возвращает массив orders:

"orders": [
{
  "_id": 10049,
  "activationlimit": 2,
  "date": 1528911062,
  "submitdate":  1528915062,
  "number": 1,
  "activationbirthdate":1528911062,
  "activationdeathdate":15210911062,
  "canoverwritecontainer": false,
  "isdemo": false,
  "description": "1234234234",
  "quantity": 2,
  "status": 1,
  "type": 0,
  "ishardwarelicense": false,
  "crmid": "",
  "refid": ""
},{

  "_id": 10048,
  "activationlimit": 3,
  "customer": {
      "_id": 8,
       "description": "test",
       "email": "cust@mail.com",
       "name": "MyCostomer",
      "phone": "123-12-12",
      "status": 0,
      "crmid": "",
      "refid": ""

 },
  "date": 1528910935,
  "submitdate":  1528915062,
  "number: 2,
  "description": "test",
  "quantity": 2,
  "status": 0,
  "type": 0,
  "ishardwarelicense": false,
  "crmid": "",
  "refid": ""
},{

  "_id": 10045,
  "activationlimit": 1,
  "date": 1528905572,
  "submitdate":  1528915062,
  "number": 3,
  "activationbirthdate":1528911062,

  "activationdeathdate":15210911062,
  "canoverwritecontainer": false,
  "isdemo": false,
  "customerrequired": true,
  "description": "TEST_UPDATE2",
  "quantity": 1,
  "status": 1,
  "type": 1,
  "ishardwarelicense": false,
  "crmid": "",
  "refid": ""
}];

Create a new order (Sale type) 

Authorization is required. RAW JSON input parameters:

{
   "customerId" : 8,

  "orderActivationBirthDate":1528911062,
  "orderActivationDeathDate":15210911062,
  "orderCanOverwriteContainer": false,

  "orderIsDemo": false,
  "customerRequired": true,
  "orderQuantity" : 10,
  "orderActivationLimit" : 10,
  "orderDescription" : "Created by Postmam",
  "orderStatus" : 0,
  "orderType" : 0,
  "isHardwareLicense": false, //it is false by default
  "crmId": "",
  "refId": ""
}

'customerId' идентификатор покупателя БД (может отсутствовать, тогда заказ не будет привязан к покупателю)

'orderQuantity' количество серийных номеров или аппаратных ключей в заказе (задаётся пользователем).

'orderActivationLimit' предел активаций для серийного номера в заказе (задаётся пользователем).

'orderDescription'  текстового описание назначения заказа(задаётся пользователем).

'orderStatus' текущий жизненный статус заказа.

'orderType' тип заказа (должно быть значение Sale).

'orderCanOverwriteContainer'   флаг, определяющий возможность перезаписать предыдущие лицензионные условия значениями из текущего заказа.

'orderIsDemo' признак демо-заказа.

'customerrequired' - флаг могут ли серийные номера активироваться без информации о клиенте.

'orderActivationBirthDate' дата начала периода доступности заказа для активации лицензии.

'orderActivationDeathDate' дата окончания периода доступности заказа для активации лицензии.

'isHardwareLicense' - тип лицензии аппаратная или программная (по умолчанию - программная - false).

 

POST /v1.0/orders

Returns the order element:

{
  "order": {
    "_id": 10052,
    "number": 1,
    "activationlimit": 10,

    "activationbirthdate":1528911062,
    "activationdeathdate":15210911062,
    "canoverwritecontainer": false,

    "isdemo": false,
    "customerrequired": true,

    "customer": {
       "_id": 8,
       "description": "test",
       "email": "cust@mail.com",
       "name": "MyCostomer",
       "phone": "123-12-12",
       "status": 0,
       "crmid": "",
       "refid": ""
    },
    "date": 0,
    "submitdate":  1528915062,
    "description": "Created by Postmam",
    "quantity": 10,
    "status": 0,
    "type": 0,
    "ishardwarelicense": false,
    "crmid": "",
    "refid": ""
  }
}

Create a new order (Update type) 

Authorization is required. RAW JSON input parameters:

{
  "orderActivationBirthDate":1528911062,
  "orderActivationDeathDate":15210911062,
  "orderCanOverwriteContainer": false,
  "serialNumber" : "4uzFSk-ccyijp-SCDd4A-FMfezU-u7Rk6y",   // опциональное поле. необходимо только если создается заказ на обновление серийного номера
  "isHardwareLicense": true,                               // опциональное поле. необходимо только если создается заказ на обновление аппаратного ключа (должно быть выставлено в true)
  "dongleId": 343242234,                                 // опциональное поле. необходимо только если создается заказ на обновление аппаратного ключа
  "orderDescription" : "Created by Postmam",
  "orderType" : 1,
  "crmId": "",
  "refId": ""
}

'serialNumber' серийных номер для которого необходимо выполнить обновление лицензионных условий (задаётся пользователем). Опциональное поле. необходимо только если создается заказ на обновление серийного номера.

'isHardwareLicense' определяет тип лицензии. опциональное поле (по умолчанию false). Должно быть true для заказа на обновление аппаратного ключа.
'dongleId'  id аппаратного ключа. Опциональное поле. Необходимо только, если создается заказ на обновление аппаратного ключа

'orderDescription'  текстового описание назначения заказа(задаётся пользователем).

'orderType' тип заказа (должно быть значение Update).

 

POST /v1.0/orders

Returns the order element:

{
  "order": {
    "_id": 10054,
    "activationlimit": 1,
    "date": 0,
    "submitdate":  1528915062,
    "number": 1,

    "activationbirthdate":1528911062,
    "activationdeathdate":15210911062,
    "canoverwritecontainer": false,

    "isdemo": false,
    "customerrequired": true,

    "description": "Created by Postmam",
    "quantity": 1,
    "status": 0,
    "type": 1,
    "ishardwarelicense": false,
    "crmid": "",
    "refid": ""
}

Change an order (Sale type)

Authorization is required. RAW JSON input parameters:

{
  "orderActivationBirthDate":1528911062,
  "orderActivationDeathDate":15210911062,
  "orderCanOverwriteContainer": false,
  "customeRrequired": true,
  "customerId": 123213
  "orderQuantity" : 20,
  "orderActivationLimit" : 20,
  "orderDescription" : "Created by Postmam",
  "orderStatus" : 0,
  "orderIsDemo": false,
  "isHardwareLicense": false,
  "crmId": "",
  "refId": ""
}

PUT /v1.0/orders/{id}

Returns the order element:

{
   "order": {
   "_id": 10051,
   "activationlimit": 20,
   "date": 0, 
   "submitdate":  1528915062,
   "number": 1,
   "activationbirthdate":1528911062,
   "activationdeathdate":15210911062,
   "canoverwritecontainer": false,
   "isdemo": false,
   "customerrequired": true,
   "description": "Created by Postmam",
   "quantity": 20,
   "status": 0,
   "type": 0,
   "ishardwarelicense": false,
   "crmid": "",
   "refid": ""
}
}

Change an order (Update type) 

Authorization is required. RAW JSON input parameters:

{
  "orderActivationBirthDate":1528911062,
  "orderActivationDeathDate":15210911062,
  "orderCanOverwriteContainer": false,
  "orderDescription" : "Created by Postmam",
  "orderStatus" : 0,
  "crmId": "",
  "refId": ""
}

PUT /v1.0/orders/{id}

Returns the order element:

{
  "order": {
  "_id": 10054,
  "activationlimit": 1,
  "date": 0, 
  "submitdate":  1528915062,
  "number": 1,
  "activationbirthdate":1528911062,
  "activationdeathdate":15210911062,
  "canoverwritecontainer": false,
  "isdemo": false,
  "customerrequired": true,
  "description": "Created by Postman",
  "quantity": 1,
  "status": 0,
  "type": 1,
  "ishardwarelicense": false,
  "crmid": "",
  "refid": ""
}
}

The following additional errors may be received when confirming your order for hardware keys:

  • Hardware key does not support time limited features (error code 10172);
  • Hardware key does not support network features (error code 10173);
  • The number of network licenses in the order exceeds the network resource of the key (error code 10174).

In case of errors 10172 and 10173 are received, the response to the request will contain the following fields: hardware key ID, feature number, product number, order number together with the error description. For example:

{
   "conflictedDongleId":999392418,
   "conflictedFeatureNumber":16,
   "conflictedOrderNumber":94,
   "conflictedProductNumber":12350,
   "status":{"code":10172,"description":"Hardware key does not support time limited features","message":"Bad Request","status":400}
}

In case of error 10174, the response to your request will contain, only the hardware key ID value together with the error description. 

Delete an order

Authorization is required. There are no input parameters.

DELETE /v1.0/orders/{id}

Receive an order by ID 

Authorization is required. There are no input parameters.

GET /v1.0/orders/{id}

Returns the order element.

Sample response (for hardware key order):

{
    "order": {
        "_id": 471,
        "activationbirthdate": 1571130180,
        "activationdeathdate": 0,
        "activationlimit": 0,
        "archivationdate": 0,
        "archived": false,
        "canoverwritecontainer": false,
        "crmid": "",
        "customer": {
            "_id": 10,
            "archivationdate": 0,
            "archived": false,
            "companyname": "baskin&robings",
            "crmid": "",
            "description": "",
            "email": "dfgsfg@dfg-df.com",
            "lastname": "cream",
            "name": "ice",
            "phone": "+349534534534",
            "refid": "",
            "status": 0
        },
        "customerrequired": false,
        "date": 1571130686,
        "description": "",
        "dongles": [
            {
                "dongleid": 991846791,
                "lastburn": {
                    "_id": 113,
                    "actiondate": 1571403137,
                    "actionresult": 0,
                    "activationsconsumed": 0,
                    "activationscountcurrent": 41
                },
                "model": 2,
                "netresource": 0,
                "publiccode": 1368487351,
                "typeflags": 442
            }
        ],
        "isdemo": true,
        "ishardwarelicense": true,
        "number": 70,
        "products": [
            {
                "_id": 126,
                "accesscode_id": -1,
                "archivationdate": 0,
                "archived": false,
                "binding": {
                    "CAN_REPLACE_CPU": false,
                    "CAN_REPLACE_DVD": false,
                    "CAN_REPLACE_HDD": false,
                    "CAN_REPLACE_MAC": false,
                    "CAN_REPLACE_MOTHERBOARD": false,
                    "CAN_REPLACE_OS": false,
                    "CPU": true,
                    "DVD": false,
                    "HDD": true,
                    "MAC": true,
                    "MOTHERBOARD": true,
                    "OS": false
                },
                "binding_maxhardwarechangenumber": 0,
                "binding_scheme": 0,
                "crmid": "",
                "description": "test_firmware_product778",
                "flags": 0,
                "hardwarebindingscheme": 0,
                "licensetype": 0,
                "modification": 0,
                "name": "test_firmware_product778",
                "productnumber": 778,
                "refid": "",
                "status": 1,
				"memoryitems": []
            }
        ],
        "quantity": 1,
        "refid": "",
        "status": 1,
        "submitdate": 1571130723,
        "type": 1
    }
}

Add a product to an order

Authorization is required. There are no input parameters.

POST /v1.0/orders/{id}/products/{pid}

Remove a product from an order 

Authorization is required. There are no input parameters.

DELETE /v1.0/orders/{id}/products/{pid}

Add a feature to a product in an order

Authorization is required. There are no input parameters.

POST /v1.0/orders/{id}/products/{pid}/features{fid}

Returns the 'license' element:

{
  "license": {
  "consumptionmode": 0,
  "flags": 0,
  "netlicensescount": 12,
  "rentbegindate": 0,
  "rentdayscount": 55,
  "rentenddate": 0,
  "runcounter": 0,
  "licensingmodel": 4,
  "isremote": true
}
}

Remove a feature from a product in an order

Authorization is required. There are no input parameters.

DELETE /v1.0/orders/{id}/products/{pid}/features{fid}

Get all product features in an order 

Authorization is required. There are no input parameters.

GET /v1.0/orders/{id}/products/{pid}/features

Returns the 'features' array:

{
    "features": [
        {
            "_id": 14,
            "archivationdate": 0,
            "archived": false,
            "crmid": "",
            "defaultLicense": {
                "canexclude": false,
                "canmodify": false,
                "consumptionmode": 0,
                "flags": 4,
                "isremote": false,
                "licensingmodel": 2,
                "netlicensescount": 0,
                "rentbegindate": 1565273129,
                "rentdayscount": 0,
                "rentenddate": 1596895529,
                "runcounter": 0
            },
            "description": "f4",
            "featurenumber": 4,
			"pubkey":"F9 E5 EC 6B 52 54 BC 80 45 7D 49 BB F0 61 F9 F2 EC AA 9F 63 79 32 0A B6 77 44 8A E7 16 AC C1 82 8A 14 73 1E 56 B6 EF 53"
            "license": {
                "consumptionmode": 0,
                "flags": 4,
                "isExcluded": 0,
                "isremote": false,
                "licensingmodel": 2,
                "netlicensescount": 0,
                "rentbegindate": 1565273129,
                "rentdayscount": 0,
                "rentenddate": 1596895529,
                "runcounter": 0
            },
            "name": "f4",
            "refid": ""
        },
        {
            "_id": 31,
            "archivationdate": 0,
            "archived": false,
            "crmid": "",
            "defaultLicense": {
                "canexclude": true,
                "canmodify": true,
                "consumptionmode": 0,
                "flags": 4,
                "isremote": true,
                "licensingmodel": 1,
                "netlicensescount": 11,
                "rentbegindate": 0,
                "rentdayscount": 0,
                "rentenddate": 0,
                "runcounter": 0
            },
            "description": "Created by postMan",
            "featurenumber": 8,
            "pubkey":"F9 E5 EC 6B 52 54 BC 80 45 7D 49 BB F0 61 F9 F2 EC AA 9F 63 79 32 0A B6 77 44 8A E7 16 AC C1 82 8A 14 73 1E 56 B6 EF 53"
            "license": {
                "consumptionmode": 0,
                "flags": 4,
                "isExcluded": 1,
                "isremote": true,
                "licensingmodel": 1,
                "netlicensescount": 11,
                "rentbegindate": 0,
                "rentdayscount": 0,
                "rentenddate": 0,
                "runcounter": 0
            },
            "name": ",PostMan",
            "refid": ""
        }
    ]
}

Change the license terms for a product feature in an order 

Authorization is required. RAW JSON input parameters (the set of fields depends on the licensing type):

{
  "licensingmodel": 4,
  "licenseRentBeginDate" : 0,
  "licenseRentEndDate" : 0,
  "licenseRentDaysCount" : 55,
  "licenseNetLicenseCount" : 12,
  "consumptionmode" : 0,
  "flags" : 0,
  "licenseRuncounter": 0,
  "isRemote": true
}

PUT /v1.0/orders/{id}/products/{pid}/features/{fid}

Returns the 'licence' element:

{
  "license": {
  "consumptionmode": 0,
  "flags": 0,
  "netlicensescount": 12,
  "rentbegindate": 0,
  "rentdayscount": 55,
  "rentenddate": 0,
  "runcounter": 0,
  "licensingmodel": 4,
  "isremote": true
}
}

Change a memory cell in an order product 

Authorization is required. RAW JSON input parameters:

{
	"data": "AdaFFFlgYWJj=="
}

PUT /v1.0/orders/{id}/products/{pid}/memoryitems/{mid}/params/{paramid}

Returns the param element:

{
    "param": {
        "_id": 3,
        "data": "AdaFFFlgYWJj",
        "description": "param1",
        "editallowed": true,
        "name": "param1",
        "offset": 20,
        "size": 10
    }
}

Get licenses, serial numbers and hardware keys

Authorization is required. RAW JSON input parameters:

{
    "keySearchValue":"wubSTT", // optional parameter
    "clientId":  10,           // optional parameter
    "productId": "20490",      // optional parameter
    "orderNumber": "21626"         // optional parameter
}

POST /v1.0/search/license

Returns an object containing the serialnumbers and dongles arrays:

{
    "dongles": [],
    "serialnumbers": [
        {
            "_id": 20910,
            "activationcount": 0,
            "activationlimit": 3,
            "customer": {
                "_id": 10,
                "archivationdate": 0,
                "archived": false,
                "companyname": "baskin&robings",
                "crmid": "",
                "description": "",
                "email": "dfgsfg@dfg-df.com",
                "lastname": "cream",
                "name": "ice",
                "phone": "+349534534534",
                "refid": "",
                "status": 0
            },
            "dongleid": -1359759134,
            "licensecontainerversion": 0,
            "memoryitems": [
                {
                    "_id": 10187,
                    "accesstype": 0,
                    "action": 0,
                    "aliasid": 500,
                    "archivationdate": 0,
                    "archived": false,
                    "crmid": "",
                    "description": "",
                    "draft": false,
                    "maxaccesserrors": 5,
                    "name": "item500",
                    "params": [
                        {
                            "_id": 10235,
                            "data": "AAHiQA==",
                            "datatype": 1,
                            "description": "",
                            "editallowed": true,
                            "name": "123456",
                            "offset": 0,
                            "size": 4
                        }
                    ],
                    "readpassword": 0,
                    "refid": "",
                    "size": 0,
                    "totalparams_size": 4,
                    "writepassword": 0
                }
            ],
            "products": [
                {
                    "_id": 20490,
                    "accesscode_id": 18,
                    "archivationdate": 0,
                    "archived": false,
                    "binding": {
                        "CAN_REPLACE_CPU": false,
                        "CAN_REPLACE_DVD": false,
                        "CAN_REPLACE_HDD": false,
                        "CAN_REPLACE_MAC": false,
                        "CAN_REPLACE_MOTHERBOARD": false,
                        "CAN_REPLACE_OS": false,
                        "CPU": true,
                        "DVD": false,
                        "HDD": true,
                        "MAC": true,
                        "MOTHERBOARD": true,
                        "OS": false
                    },
                    "binding_maxhardwarechangenumber": 0,
                    "binding_scheme": 0,
                    "crmid": "",
                    "description": "",
                    "featuresWithLicenses": [
                        {
                            "_id": 136,
                            "archivationdate": 0,
                            "archived": false,
                            "crmid": "",
                            "defaultLicense": {
                                "canexclude": true,
                                "canmodify": true,
                                "consumptionmode": 0,
                                "flags": 0,
                                "isremote": false,
                                "licensingmodel": 1,
                                "netlicensescount": 0,
                                "rentbegindate": 0,
                                "rentdayscount": 0,
                                "rentenddate": 0,
                                "runcounter": 0
                            },
                            "description": "f12274",
                            "featurenumber": 12274,
                            "license": {
                                "consumptionmode": 0,
                                "flags": 0,
                                "isExcluded": 0,
                                "isremote": false,
                                "licensingmodel": 1,
                                "netlicensescount": 0,
                                "rentbegindate": 0,
                                "rentdayscount": 0,
                                "rentenddate": 0,
                                "runcounter": 0
                            },
                            "name": "f12274",
                            "pubkey": "61 78 04 38 6F CC 61 9A E3 38 C6 11 12 8A 95 7B B0 A6 1B 41 E4 8D 17 B6 6F AE 1F 03 91 9A 68 88 B7 9A 8E 55 34 57 C4 58",
                            "refid": ""
                        }
                    ],
                    "flags": 0,
                    "hardwarebindingscheme": 0,
                    "licensetype": 0,
                    "memoryitems": [
                        {
                            "_id": 10187,
                            "accesstype": 0,
                            "action": 0,
                            "aliasid": 500,
                            "archivationdate": 0,
                            "archived": false,
                            "crmid": "",
                            "description": "",
                            "draft": false,
                            "maxaccesserrors": 5,
                            "name": "item500",
                            "params": [
                                {
                                    "_id": 10235,
                                    "data": "AAHiQA==",
                                    "datatype": 1,
                                    "description": "",
                                    "editallowed": true,
                                    "name": "123456",
                                    "offset": 0,
                                    "size": 4
                                }
                            ],
                            "readpassword": 0,
                            "refid": "",
                            "size": 0,
                            "totalparams_size": 4,
                            "writepassword": 0
                        }
                    ],
                    "modification": 0,
                    "name": "mem_pr",
                    "productnumber": 45369,
                    "refid": "",
                    "status": 1
                }
            ],
            "serialstring": "VJ7jgF-wubSTT-yt1TMj-utpB2R-BEuNb8",
            "status": 0
        }
    ]
}
  • No labels