BokaMera.API.Host

<back to all web services

GetVossProducts

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
GET/voss/productsgets voss products
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


enum ProductTypeEnum : string
{
    case Main = 'Main';
    case Addon = 'Addon';
    case License = 'License';
    case Usage = 'Usage';
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class GetVossProducts implements JsonSerializable
{
    public function __construct(
        /** @description The type of the product  - Main = The product is treated as the main product of the product group (Only 1 allowed per product family in the package tier), billed in subscription billing period  - Addon = The product is treated as the addon product of the product group (Multiple allowed per product family in the package tier when Main product is also present),  billed in subscription billing period  - License = The product is treated as the license product in the product group (Multiple allowed per product family in the package tier when Main product is also present),  billed in subscription billing period and product quantity is carried over to the next billing period,  requires to have individual pricing in a product group pricing  - Usage = The product is treated as the usage product of the product group,  billed in usage billing period, the product quantity is reset every usage billing period,  requires to have individual pricing in a product group pricing */
        // @ApiMember(Description="The type of the product  - Main = The product is treated as the main product of the product group (Only 1 allowed per product family in the package tier), billed in subscription billing period  - Addon = The product is treated as the addon product of the product group (Multiple allowed per product family in the package tier when Main product is also present),  billed in subscription billing period  - License = The product is treated as the license product in the product group (Multiple allowed per product family in the package tier when Main product is also present),  billed in subscription billing period and product quantity is carried over to the next billing period,  requires to have individual pricing in a product group pricing  - Usage = The product is treated as the usage product of the product group,  billed in usage billing period, the product quantity is reset every usage billing period,  requires to have individual pricing in a product group pricing\n")
        /** @var ProductTypeEnum|null */
        public ?ProductTypeEnum $ProductType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ProductType'])) $this->ProductType = JsonConverters::from('ProductTypeEnum', $o['ProductType']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ProductType)) $o['ProductType'] = JsonConverters::to('ProductTypeEnum', $this->ProductType);
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetVossProducts DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /voss/products HTTP/1.1 
Host: api.bokamera.se 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

[{"Name":"String","ArticleNumber":"String"}]