digitaluapi

<back to all web services

CompaniesLookup

Requires Authentication
Requires any of the roles:Client, Admin, Partner
The following routes are available for this service:
GET/companies
<?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};


// @DataContract
class CompaniesLookup implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=2)
        /** @var string|null */
        public ?string $Name=null,

        // @DataMember(Order=3)
        /** @var string|null */
        public ?string $RegNo=null,

        // @DataMember(Order=4)
        /** @var int|null */
        public ?int $CountriesId=null,

        // @DataMember(Order=5)
        /** @var string|null */
        public ?string $State=null,

        // @DataMember(Order=6)
        /** @var string|null */
        public ?string $City=null,

        // @DataMember(Order=7)
        /** @var string|null */
        public ?string $StreetAddress=null,

        // @DataMember(Order=8)
        /** @var string|null */
        public ?string $Zip=null,

        // @DataMember(Order=9)
        /** @var string|null */
        public ?string $TaxNo=null,

        // @DataMember(Order=10)
        /** @var float|null */
        public ?float $SalesTaxPercentage=null,

        // @DataMember(Order=11)
        /** @var string|null */
        public ?string $Email=null,

        // @DataMember(Order=12)
        /** @var string|null */
        public ?string $Website=null,

        // @DataMember(Order=13)
        /** @var string|null */
        public ?string $PhoneNumber=null,

        // @DataMember(Order=14)
        /** @var string|null */
        public ?string $LogoUrl=null,

        // @DataMember(Order=15)
        /** @var int */
        public int $CurrenciesId=0,

        // @DataMember(Order=16)
        /** @var int */
        public int $StatusCodesId=0,

        // @DataMember(Order=17)
        /** @var float|null */
        public ?float $Lat=null,

        // @DataMember(Order=18)
        /** @var float|null */
        public ?float $Lng=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['RegNo'])) $this->RegNo = $o['RegNo'];
        if (isset($o['CountriesId'])) $this->CountriesId = $o['CountriesId'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['StreetAddress'])) $this->StreetAddress = $o['StreetAddress'];
        if (isset($o['Zip'])) $this->Zip = $o['Zip'];
        if (isset($o['TaxNo'])) $this->TaxNo = $o['TaxNo'];
        if (isset($o['SalesTaxPercentage'])) $this->SalesTaxPercentage = $o['SalesTaxPercentage'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['Website'])) $this->Website = $o['Website'];
        if (isset($o['PhoneNumber'])) $this->PhoneNumber = $o['PhoneNumber'];
        if (isset($o['LogoUrl'])) $this->LogoUrl = $o['LogoUrl'];
        if (isset($o['CurrenciesId'])) $this->CurrenciesId = $o['CurrenciesId'];
        if (isset($o['StatusCodesId'])) $this->StatusCodesId = $o['StatusCodesId'];
        if (isset($o['Lat'])) $this->Lat = $o['Lat'];
        if (isset($o['Lng'])) $this->Lng = $o['Lng'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->RegNo)) $o['RegNo'] = $this->RegNo;
        if (isset($this->CountriesId)) $o['CountriesId'] = $this->CountriesId;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->StreetAddress)) $o['StreetAddress'] = $this->StreetAddress;
        if (isset($this->Zip)) $o['Zip'] = $this->Zip;
        if (isset($this->TaxNo)) $o['TaxNo'] = $this->TaxNo;
        if (isset($this->SalesTaxPercentage)) $o['SalesTaxPercentage'] = $this->SalesTaxPercentage;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->Website)) $o['Website'] = $this->Website;
        if (isset($this->PhoneNumber)) $o['PhoneNumber'] = $this->PhoneNumber;
        if (isset($this->LogoUrl)) $o['LogoUrl'] = $this->LogoUrl;
        if (isset($this->CurrenciesId)) $o['CurrenciesId'] = $this->CurrenciesId;
        if (isset($this->StatusCodesId)) $o['StatusCodesId'] = $this->StatusCodesId;
        if (isset($this->Lat)) $o['Lat'] = $this->Lat;
        if (isset($this->Lng)) $o['Lng'] = $this->Lng;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CompaniesLookup DTOs

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

HTTP + XML

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

GET /companies HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ArrayOfCompaniesLookupResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/digitaluapi.ServiceModel">
  <CompaniesLookupResponse>
    <City>String</City>
    <CountriesId>0</CountriesId>
    <CurrenciesId>0</CurrenciesId>
    <Email>String</Email>
    <Lat>0</Lat>
    <Lng>0</Lng>
    <LogoUrl>String</LogoUrl>
    <Name>String</Name>
    <PhoneNumber>String</PhoneNumber>
    <RegNo>String</RegNo>
    <ResponseStatus xmlns:d3p1="http://schemas.servicestack.net/types">
      <d3p1:ErrorCode>String</d3p1:ErrorCode>
      <d3p1:Message>String</d3p1:Message>
      <d3p1:StackTrace>String</d3p1:StackTrace>
      <d3p1:Errors>
        <d3p1:ResponseError>
          <d3p1:ErrorCode>String</d3p1:ErrorCode>
          <d3p1:FieldName>String</d3p1:FieldName>
          <d3p1:Message>String</d3p1:Message>
          <d3p1:Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </d3p1:Meta>
        </d3p1:ResponseError>
      </d3p1:Errors>
      <d3p1:Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d3p1:Meta>
    </ResponseStatus>
    <SalesTaxPercentage>0</SalesTaxPercentage>
    <State>String</State>
    <StatusCodesId>0</StatusCodesId>
    <StreetAddress>String</StreetAddress>
    <TaxNo>String</TaxNo>
    <Website>String</Website>
    <Zip>String</Zip>
  </CompaniesLookupResponse>
</ArrayOfCompaniesLookupResponse>