OSZZ API

<back to all web services

Search

The following routes are available for this service:
GET/search
GET/{Ver}/search
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SearchResponse(IResponse):
    response_status: Optional[ResponseStatus] = None
    result: Optional[List[ProductModel]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Search:
    q: Optional[str] = None
    token_id: Optional[str] = None
    ver: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProductModel:
    id: Optional[str] = None
    manufacturer_title: Optional[str] = None
    number: Optional[str] = None
    title: Optional[str] = None

Python Search DTOs

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

HTTP + JSV

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

GET /search HTTP/1.1 
Host: api.oszz.ru 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	},
	result: 
	[
		{
			id: 00000000000000000000000000000000,
			manufacturerTitle: String,
			number: String,
			title: String
		}
	]
}