| Required role: | Backoffice |
| GET | /place/search |
|---|
<?php namespace BackofficeApi;
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 PlaceState : string
{
case Draft = 'Draft';
case Active = 'Active';
case Paused = 'Paused';
case Archived = 'Archived';
}
class TimeZoneDto implements JsonSerializable
{
public function __construct(
/** @var DateInterval|null */
public ?DateInterval $baseUtcOffset=null,
/** @var string */
public string $daylightName='',
/** @var string */
public string $displayName='',
/** @var string */
public string $id='',
/** @var string */
public string $standardName='',
/** @var bool|null */
public ?bool $supportsDaylightSavingTime=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['baseUtcOffset'])) $this->baseUtcOffset = JsonConverters::from('DateInterval', $o['baseUtcOffset']);
if (isset($o['daylightName'])) $this->daylightName = $o['daylightName'];
if (isset($o['displayName'])) $this->displayName = $o['displayName'];
if (isset($o['id'])) $this->id = $o['id'];
if (isset($o['standardName'])) $this->standardName = $o['standardName'];
if (isset($o['supportsDaylightSavingTime'])) $this->supportsDaylightSavingTime = $o['supportsDaylightSavingTime'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->baseUtcOffset)) $o['baseUtcOffset'] = JsonConverters::to('DateInterval', $this->baseUtcOffset);
if (isset($this->daylightName)) $o['daylightName'] = $this->daylightName;
if (isset($this->displayName)) $o['displayName'] = $this->displayName;
if (isset($this->id)) $o['id'] = $this->id;
if (isset($this->standardName)) $o['standardName'] = $this->standardName;
if (isset($this->supportsDaylightSavingTime)) $o['supportsDaylightSavingTime'] = $this->supportsDaylightSavingTime;
return empty($o) ? new class(){} : $o;
}
}
class PlaceContact implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $phone=null,
/** @var string|null */
public ?string $email=null,
/** @var string|null */
public ?string $website=null,
/** @var string|null */
public ?string $webShop=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['phone'])) $this->phone = $o['phone'];
if (isset($o['email'])) $this->email = $o['email'];
if (isset($o['website'])) $this->website = $o['website'];
if (isset($o['webShop'])) $this->webShop = $o['webShop'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->phone)) $o['phone'] = $this->phone;
if (isset($this->email)) $o['email'] = $this->email;
if (isset($this->website)) $o['website'] = $this->website;
if (isset($this->webShop)) $o['webShop'] = $this->webShop;
return empty($o) ? new class(){} : $o;
}
}
class PlaceAddress implements JsonSerializable
{
public function __construct(
/** @var string */
public string $street='',
/** @var string */
public string $postalCode='',
/** @var string */
public string $region='',
/** @var string */
public string $countryCode=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['street'])) $this->street = $o['street'];
if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
if (isset($o['region'])) $this->region = $o['region'];
if (isset($o['countryCode'])) $this->countryCode = $o['countryCode'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->street)) $o['street'] = $this->street;
if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
if (isset($this->region)) $o['region'] = $this->region;
if (isset($this->countryCode)) $o['countryCode'] = $this->countryCode;
return empty($o) ? new class(){} : $o;
}
}
enum BusinessRole : string
{
case Owner = 'Owner';
case Manager = 'Manager';
case Sales = 'Sales';
case Marketing = 'Marketing';
case Other = 'Other';
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /place/search HTTP/1.1 Host: backoffice-api.brovs.com Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<SearchPlaceResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BackofficeApi.Dto">
<Offset>0</Offset>
<Places>
<BackofficePlaceDto>
<Address xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
<d4p1:CountryCode>String</d4p1:CountryCode>
<d4p1:PostalCode>String</d4p1:PostalCode>
<d4p1:Region>String</d4p1:Region>
<d4p1:Street>String</d4p1:Street>
</Address>
<BackofficeGrantedStaffAccess>
<StaffDto>
<BusinessId>0</BusinessId>
<BusinessName>String</BusinessName>
<BusinessRole>Owner</BusinessRole>
<Email>String</Email>
<FirstName>String</FirstName>
<Id>0</Id>
<LastActiveOn xmlns:d6p1="http://schemas.datacontract.org/2004/07/System">
<d6p1:DateTime>0001-01-01T00:00:00Z</d6p1:DateTime>
<d6p1:OffsetMinutes>0</d6p1:OffsetMinutes>
</LastActiveOn>
<LastName>String</LastName>
<MobileNumber>String</MobileNumber>
<PlaceId>0</PlaceId>
<PlaceName>String</PlaceName>
<Role>Owner</Role>
<UserId>0</UserId>
</StaffDto>
</BackofficeGrantedStaffAccess>
<BusinessId>0</BusinessId>
<Claimed>false</Claimed>
<Contact xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
<d4p1:Email>String</d4p1:Email>
<d4p1:Phone>String</d4p1:Phone>
<d4p1:WebShop>String</d4p1:WebShop>
<d4p1:Website>String</d4p1:Website>
</Contact>
<CountryCode>String</CountryCode>
<Guid>00000000-0000-0000-0000-000000000000</Guid>
<Id>0</Id>
<Latitude>0</Latitude>
<Longitude>0</Longitude>
<Name>String</Name>
<OrganizationNumber>String</OrganizationNumber>
<Overview>String</Overview>
<RootCategory>
<AbsoluteSlug>String</AbsoluteSlug>
<Id>0</Id>
<Name>String</Name>
<ParentId>0</ParentId>
<Position>0</Position>
<Slug>String</Slug>
<State>String</State>
</RootCategory>
<State>Draft</State>
<TimeZoneDto xmlns:d4p1="http://schemas.datacontract.org/2004/07/Entities.Common">
<d4p1:BaseUtcOffset>PT0S</d4p1:BaseUtcOffset>
<d4p1:DaylightName>String</d4p1:DaylightName>
<d4p1:DisplayName>String</d4p1:DisplayName>
<d4p1:Id>String</d4p1:Id>
<d4p1:StandardName>String</d4p1:StandardName>
<d4p1:SupportsDaylightSavingTime>false</d4p1:SupportsDaylightSavingTime>
</TimeZoneDto>
</BackofficePlaceDto>
</Places>
<Size>0</Size>
<Total>0</Total>
</SearchPlaceResponse>