digitaluapi

<back to all web services

CustomersLookup

Requires Authentication
Requires any of the roles:Client, Admin, Partner
The following routes are available for this service:
GET/customers
<?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 CustomersLookup implements JsonSerializable
{
    public function __construct(
        // @DataMember(Order=2)
        /** @var int */
        public int $TenantsId=0,

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

        // @DataMember(Order=4)
        /** @var int */
        public int $SegmentsId=0,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        // @DataMember(Order=21)
        /** @var string|null */
        public ?string $UniqueIdentifier=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['TenantsId'])) $this->TenantsId = $o['TenantsId'];
        if (isset($o['UserAuthId'])) $this->UserAuthId = $o['UserAuthId'];
        if (isset($o['SegmentsId'])) $this->SegmentsId = $o['SegmentsId'];
        if (isset($o['CompaniesId'])) $this->CompaniesId = $o['CompaniesId'];
        if (isset($o['CurrenciesId'])) $this->CurrenciesId = $o['CurrenciesId'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['Age'])) $this->Age = $o['Age'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['ContactNumber'])) $this->ContactNumber = $o['ContactNumber'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['EthnicGroup'])) $this->EthnicGroup = $o['EthnicGroup'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['Gender'])) $this->Gender = $o['Gender'];
        if (isset($o['HomeLanguage'])) $this->HomeLanguage = $o['HomeLanguage'];
        if (isset($o['IdNumber'])) $this->IdNumber = $o['IdNumber'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['PostalCode'])) $this->PostalCode = $o['PostalCode'];
        if (isset($o['Region'])) $this->Region = $o['Region'];
        if (isset($o['Suburb'])) $this->Suburb = $o['Suburb'];
        if (isset($o['UniqueIdentifier'])) $this->UniqueIdentifier = $o['UniqueIdentifier'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->TenantsId)) $o['TenantsId'] = $this->TenantsId;
        if (isset($this->UserAuthId)) $o['UserAuthId'] = $this->UserAuthId;
        if (isset($this->SegmentsId)) $o['SegmentsId'] = $this->SegmentsId;
        if (isset($this->CompaniesId)) $o['CompaniesId'] = $this->CompaniesId;
        if (isset($this->CurrenciesId)) $o['CurrenciesId'] = $this->CurrenciesId;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->Age)) $o['Age'] = $this->Age;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->ContactNumber)) $o['ContactNumber'] = $this->ContactNumber;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->EthnicGroup)) $o['EthnicGroup'] = $this->EthnicGroup;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->Gender)) $o['Gender'] = $this->Gender;
        if (isset($this->HomeLanguage)) $o['HomeLanguage'] = $this->HomeLanguage;
        if (isset($this->IdNumber)) $o['IdNumber'] = $this->IdNumber;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->PostalCode)) $o['PostalCode'] = $this->PostalCode;
        if (isset($this->Region)) $o['Region'] = $this->Region;
        if (isset($this->Suburb)) $o['Suburb'] = $this->Suburb;
        if (isset($this->UniqueIdentifier)) $o['UniqueIdentifier'] = $this->UniqueIdentifier;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CustomersLookup 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 /customers HTTP/1.1 
Host: duengageapi.uat.scadsoftware.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

[{"TenantsId":0,"UserAuthId":0,"SegmentsId":0,"CompaniesId":0,"CurrenciesId":0,"Address":"String","Age":0,"City":"String","ContactNumber":"String","Email":"String","EthnicGroup":"String","FirstName":"String","Gender":"String","HomeLanguage":"String","IdNumber":"String","LastName":"String","PostalCode":"String","Region":"String","Suburb":"String","UniqueIdentifier":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}]