Platform API

<back to all web services

GetContactRolesForLicensee

Get contact roles (custom and/or standard) for the specified licensee

Requires Authentication
The following routes are available for this service:
All Verbs/api/contactroles/{LicenseeId}
<?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};


class RoleModel implements JsonSerializable
{
    public function __construct(
        /** @description Role Id */
        // @ApiMember(DataType="Guid", Description="Role Id", IsRequired=true, Name="RoleId")
        /** @var string */
        public string $RoleId='',

        /** @description Role Name */
        // @ApiMember(DataType="string", Description="Role Name", Name="RoleName")
        /** @var string|null */
        public ?string $RoleName=null,

        /** @description Is the role a licensee role? */
        // @ApiMember(DataType="bool", Description="Is the role a licensee role?", Name="IsLicensee")
        /** @var bool|null */
        public ?bool $IsLicenseeRole=null,

        /** @description Is manage contacts role? */
        // @ApiMember(DataType="bool", Description="Is manage contacts role?", Name="IsManageContacts")
        /** @var bool|null */
        public ?bool $IsManageContacts=null,

        /** @description Is the role a Platform role? */
        // @ApiMember(DataType="bool", Description="Is the role a Platform role?", Name="IsPlatformRole")
        /** @var bool|null */
        public ?bool $IsPlatformRole=null,

        /** @description Is the role a services role? */
        // @ApiMember(DataType="bool", Description="Is the role a services role?", Name="IsServiceRole")
        /** @var bool|null */
        public ?bool $IsServiceRole=null,

        /** @description Is the role a customer role? */
        // @ApiMember(DataType="bool", Description="Is the role a customer role?", Name="IsCustomerRole")
        /** @var bool|null */
        public ?bool $IsCustomerRole=null,

        /** @description Is the role a functional role? */
        // @ApiMember(DataType="bool", Description="Is the role a functional role?", Name="IsFunctionalRole")
        /** @var bool|null */
        public ?bool $IsFunctionalRole=null,

        /** @description Is the role an auto-accept role? */
        // @ApiMember(DataType="bool", Description="Is the role an auto-accept role?", Name="IsRequestAutoAccepted")
        /** @var bool|null */
        public ?bool $IsRequestAutoAccepted=null,

        /** @description Suite that the role belongs to */
        // @ApiMember(DataType="Guid", Description="Suite that the role belongs to", Name="SuiteId")
        /** @var string */
        public string $SuiteId='',

        /** @description Suite that the role belongs to */
        // @ApiMember(DataType="string", Description="Suite that the role belongs to", Name="SuiteName")
        /** @var string|null */
        public ?string $SuiteName=null,

        /** @description 'A' (Active) or 'I' (Inactive) */
        // @ApiMember(DataType="string", Description="'A' (Active) or 'I' (Inactive)", Name="RecordStatus")
        /** @var string|null */
        public ?string $RecordStatus=null,

        /** @description Object Connection Id, which is populated when the roles are returned based on those that are connected to an object. */
        // @ApiMember(DataType="Guid", Description="Object Connection Id, which is populated when the roles are returned based on those that are connected to an object.", Name="ObjectConnectionId")
        /** @var string */
        public string $ObjectConnectionId=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RoleId'])) $this->RoleId = $o['RoleId'];
        if (isset($o['RoleName'])) $this->RoleName = $o['RoleName'];
        if (isset($o['IsLicenseeRole'])) $this->IsLicenseeRole = $o['IsLicenseeRole'];
        if (isset($o['IsManageContacts'])) $this->IsManageContacts = $o['IsManageContacts'];
        if (isset($o['IsPlatformRole'])) $this->IsPlatformRole = $o['IsPlatformRole'];
        if (isset($o['IsServiceRole'])) $this->IsServiceRole = $o['IsServiceRole'];
        if (isset($o['IsCustomerRole'])) $this->IsCustomerRole = $o['IsCustomerRole'];
        if (isset($o['IsFunctionalRole'])) $this->IsFunctionalRole = $o['IsFunctionalRole'];
        if (isset($o['IsRequestAutoAccepted'])) $this->IsRequestAutoAccepted = $o['IsRequestAutoAccepted'];
        if (isset($o['SuiteId'])) $this->SuiteId = $o['SuiteId'];
        if (isset($o['SuiteName'])) $this->SuiteName = $o['SuiteName'];
        if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
        if (isset($o['ObjectConnectionId'])) $this->ObjectConnectionId = $o['ObjectConnectionId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RoleId)) $o['RoleId'] = $this->RoleId;
        if (isset($this->RoleName)) $o['RoleName'] = $this->RoleName;
        if (isset($this->IsLicenseeRole)) $o['IsLicenseeRole'] = $this->IsLicenseeRole;
        if (isset($this->IsManageContacts)) $o['IsManageContacts'] = $this->IsManageContacts;
        if (isset($this->IsPlatformRole)) $o['IsPlatformRole'] = $this->IsPlatformRole;
        if (isset($this->IsServiceRole)) $o['IsServiceRole'] = $this->IsServiceRole;
        if (isset($this->IsCustomerRole)) $o['IsCustomerRole'] = $this->IsCustomerRole;
        if (isset($this->IsFunctionalRole)) $o['IsFunctionalRole'] = $this->IsFunctionalRole;
        if (isset($this->IsRequestAutoAccepted)) $o['IsRequestAutoAccepted'] = $this->IsRequestAutoAccepted;
        if (isset($this->SuiteId)) $o['SuiteId'] = $this->SuiteId;
        if (isset($this->SuiteName)) $o['SuiteName'] = $this->SuiteName;
        if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
        if (isset($this->ObjectConnectionId)) $o['ObjectConnectionId'] = $this->ObjectConnectionId;
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="List of contact roles (custom and/or standard) for the specified licensee")
class GetContactRolesForLicenseeResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<RoleModel>|null */
        public ?array $Roles=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

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

/** @description Get contact roles (custom and/or standard) for the specified licensee */
// @Api(Description="Get contact roles (custom and/or standard) for the specified licensee")
class GetContactRolesForLicensee implements JsonSerializable
{
    public function __construct(
        /** @description Get contact roles (custom and/or standard) for the specified licensee */
        // @ApiMember(DataType="Guid", Description="Get contact roles (custom and/or standard) for the specified licensee", IsRequired=true, Name="LicenseeId", ParameterType="query")
        /** @var string */
        public string $LicenseeId='',

        /** @description Contact Types */
        // @ApiMember(DataType="List<Guid>", Description="Contact Types", Name="ContactTypes", ParameterType="query")
        /** @var array<string>|null */
        public ?array $ContactTypes=null,

        /** @description Custom/Standard filter */
        // @ApiMember(DataType="List<Guid>", Description="Custom/Standard filter", Name="OwnerFilterIds", ParameterType="query")
        /** @var array<string>|null */
        public ?array $OwnerFilterIds=null,

        /** @description Active/Archived filter */
        // @ApiMember(DataType="string", Description="Active/Archived filter", Name="RecordStatus", ParameterType="query")
        /** @var string|null */
        public ?string $RecordStatus=null,

        /** @description Text filter */
        // @ApiMember(DataType="string", Description="Text filter", Name="SearchText", ParameterType="query")
        /** @var string|null */
        public ?string $SearchText=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LicenseeId'])) $this->LicenseeId = $o['LicenseeId'];
        if (isset($o['ContactTypes'])) $this->ContactTypes = JsonConverters::fromArray('Guid', $o['ContactTypes']);
        if (isset($o['OwnerFilterIds'])) $this->OwnerFilterIds = JsonConverters::fromArray('Guid', $o['OwnerFilterIds']);
        if (isset($o['RecordStatus'])) $this->RecordStatus = $o['RecordStatus'];
        if (isset($o['SearchText'])) $this->SearchText = $o['SearchText'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LicenseeId)) $o['LicenseeId'] = $this->LicenseeId;
        if (isset($this->ContactTypes)) $o['ContactTypes'] = JsonConverters::toArray('Guid', $this->ContactTypes);
        if (isset($this->OwnerFilterIds)) $o['OwnerFilterIds'] = JsonConverters::toArray('Guid', $this->OwnerFilterIds);
        if (isset($this->RecordStatus)) $o['RecordStatus'] = $this->RecordStatus;
        if (isset($this->SearchText)) $o['SearchText'] = $this->SearchText;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetContactRolesForLicensee 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.

POST /api/contactroles/{LicenseeId} HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<GetContactRolesForLicensee xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
  <ContactTypes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
  </ContactTypes>
  <LicenseeId>00000000-0000-0000-0000-000000000000</LicenseeId>
  <OwnerFilterIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:guid>00000000-0000-0000-0000-000000000000</d2p1:guid>
  </OwnerFilterIds>
  <RecordStatus>String</RecordStatus>
  <SearchText>String</SearchText>
</GetContactRolesForLicensee>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetContactRolesForLicenseeResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Roles xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Saguna.Common.WebAPIModel.Models">
    <d2p1:RoleModel>
      <d2p1:IsCustomerRole>false</d2p1:IsCustomerRole>
      <d2p1:IsFunctionalRole>false</d2p1:IsFunctionalRole>
      <d2p1:IsLicenseeRole>false</d2p1:IsLicenseeRole>
      <d2p1:IsManageContacts>false</d2p1:IsManageContacts>
      <d2p1:IsPlatformRole>false</d2p1:IsPlatformRole>
      <d2p1:IsRequestAutoAccepted>false</d2p1:IsRequestAutoAccepted>
      <d2p1:IsServiceRole>false</d2p1:IsServiceRole>
      <d2p1:ObjectConnectionId>00000000-0000-0000-0000-000000000000</d2p1:ObjectConnectionId>
      <d2p1:RecordStatus>String</d2p1:RecordStatus>
      <d2p1:RoleId>00000000-0000-0000-0000-000000000000</d2p1:RoleId>
      <d2p1:RoleName>String</d2p1:RoleName>
      <d2p1:SuiteId>00000000-0000-0000-0000-000000000000</d2p1:SuiteId>
      <d2p1:SuiteName>String</d2p1:SuiteName>
    </d2p1:RoleModel>
  </Roles>
</GetContactRolesForLicenseeResponse>