Platform API

<back to all web services

GetLicenseeConnectedContacts

Returns a list of licensee contacts connected to a user profile' contact.

Requires Authentication
<?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 UserContactConnectionModel implements JsonSerializable
{
    public function __construct(
        /** @description The Contact Role Id, that links the Contact to their role. */
        // @ApiMember(DataType="Guid", Description="The Contact Role Id, that links the Contact to their role.", Name="ContactRoleId", ParameterType="query")
        /** @var string */
        public string $ContactRoleId='',

        /** @description The role name. */
        // @ApiMember(DataType="string", Description="The role name.", Name="ContactRoleName", ParameterType="query")
        /** @var string|null */
        public ?string $ContactRoleName=null,

        /** @description The list item role Id. */
        // @ApiMember(DataType="Guid", Description="The list item role Id.", Name="ContactListItemRoleId", ParameterType="query")
        /** @var string */
        public string $ContactListItemRoleId='',

        /** @description The URL of the contact role's image icon. */
        // @ApiMember(DataType="string", Description="The URL of the contact role's image icon.", Name="ContactRolePrimaryImageURL", ParameterType="query")
        /** @var string|null */
        public ?string $ContactRolePrimaryImageURL=null,

        /** @description The URL of the contact role's thumbnail image icon. */
        // @ApiMember(DataType="string", Description="The URL of the contact role's thumbnail image icon.", Name="ContactRolePrimaryImageThumbnailURL", ParameterType="query")
        /** @var string|null */
        public ?string $ContactRolePrimaryImageThumbnailURL=null,

        /** @description The Guid of the contact role's media file containing the image icon details. */
        // @ApiMember(DataType="string", Description="The Guid of the contact role's media file containing the image icon details.", Name="ContactRolePrimaryImageId", ParameterType="query")
        /** @var string */
        public string $ContactRolePrimaryImageId='',

        /** @description The connected contacts Id. (licensee) */
        // @ApiMember(DataType="string", Description="The connected contacts Id. (licensee)", Name="ConnectionContactId", ParameterType="query")
        /** @var string */
        public string $ConnectionContactId='',

        /** @description The connected contacts Full Name. */
        // @ApiMember(DataType="string", Description="The connected contacts Full Name.", Name="ConnectionContactName", ParameterType="query")
        /** @var string|null */
        public ?string $ConnectionContactName=null,

        /** @description The connected contacts role. */
        // @ApiMember(DataType="string", Description="The connected contacts role.", Name="ConnectionContactRoleName", ParameterType="query")
        /** @var string|null */
        public ?string $ConnectionContactRoleName=null,

        /** @description The connected contacts role Id. */
        // @ApiMember(DataType="Guid", Description="The connected contacts role Id.", Name="ConnectionContactRoleId", ParameterType="query")
        /** @var string */
        public string $ConnectionContactRoleId='',

        /** @description The connected contacts list item role Id. */
        // @ApiMember(DataType="Guid", Description="The connected contacts list item role Id.", Name="ConnectionContactListItemRoleId", ParameterType="query")
        /** @var string */
        public string $ConnectionContactListItemRoleId='',

        /** @description The Contacts Type. */
        // @ApiMember(DataType="string", Description="The Contacts Type.", Name="ContactTypeName", ParameterType="query")
        /** @var string|null */
        public ?string $ContactTypeName=null,

        /** @description The URL to the Connected Contacts Photo. */
        // @ApiMember(DataType="string", Description="The URL to the Connected Contacts Photo.", Name="ConnectionContactPhotoURL", ParameterType="query")
        /** @var string|null */
        public ?string $ConnectionContactPhotoURL=null,

        /** @description . */
        // @ApiMember(DataType="bool", Description=".", Name="IsContactLicenseeRole", ParameterType="query")
        /** @var bool|null */
        public ?bool $IsContactLicenseeRole=null,

        /** @description If the connection is as a licensee this is true. */
        // @ApiMember(DataType="bool", Description="If the connection is as a licensee this is true.", Name="IsConnectionLicenseeRole", ParameterType="query")
        /** @var bool|null */
        public ?bool $IsConnectionLicenseeRole=null,

        /** @description The status of the connection with the contact. */
        // @ApiMember(DataType="string", Description="The status of the connection with the contact.", Name="ConnectionStatusName", ParameterType="query")
        /** @var string|null */
        public ?string $ConnectionStatusName=null,

        /** @description The status Id of the connection with the contact. */
        // @ApiMember(DataType="Guid", Description="The status Id of the connection with the contact.", Name="ConnectionStatusId", ParameterType="query")
        /** @var string */
        public string $ConnectionStatusId='',

        /** @description The ContactRoleConnectionId of an active connection with the contact. */
        // @ApiMember(DataType="Guid", Description="The ContactRoleConnectionId of an active connection with the contact.", Name="ConnectionId", ParameterType="query")
        /** @var string */
        public string $ConnectionId='',

        /** @description The ContactRoleConnectionRequest of a pending connection with the contact. */
        // @ApiMember(DataType="Guid", Description="The ContactRoleConnectionRequest of a pending connection with the contact.", Name="ConnectionRequestId", ParameterType="query")
        /** @var string */
        public string $ConnectionRequestId=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContactRoleId'])) $this->ContactRoleId = $o['ContactRoleId'];
        if (isset($o['ContactRoleName'])) $this->ContactRoleName = $o['ContactRoleName'];
        if (isset($o['ContactListItemRoleId'])) $this->ContactListItemRoleId = $o['ContactListItemRoleId'];
        if (isset($o['ContactRolePrimaryImageURL'])) $this->ContactRolePrimaryImageURL = $o['ContactRolePrimaryImageURL'];
        if (isset($o['ContactRolePrimaryImageThumbnailURL'])) $this->ContactRolePrimaryImageThumbnailURL = $o['ContactRolePrimaryImageThumbnailURL'];
        if (isset($o['ContactRolePrimaryImageId'])) $this->ContactRolePrimaryImageId = $o['ContactRolePrimaryImageId'];
        if (isset($o['ConnectionContactId'])) $this->ConnectionContactId = $o['ConnectionContactId'];
        if (isset($o['ConnectionContactName'])) $this->ConnectionContactName = $o['ConnectionContactName'];
        if (isset($o['ConnectionContactRoleName'])) $this->ConnectionContactRoleName = $o['ConnectionContactRoleName'];
        if (isset($o['ConnectionContactRoleId'])) $this->ConnectionContactRoleId = $o['ConnectionContactRoleId'];
        if (isset($o['ConnectionContactListItemRoleId'])) $this->ConnectionContactListItemRoleId = $o['ConnectionContactListItemRoleId'];
        if (isset($o['ContactTypeName'])) $this->ContactTypeName = $o['ContactTypeName'];
        if (isset($o['ConnectionContactPhotoURL'])) $this->ConnectionContactPhotoURL = $o['ConnectionContactPhotoURL'];
        if (isset($o['IsContactLicenseeRole'])) $this->IsContactLicenseeRole = $o['IsContactLicenseeRole'];
        if (isset($o['IsConnectionLicenseeRole'])) $this->IsConnectionLicenseeRole = $o['IsConnectionLicenseeRole'];
        if (isset($o['ConnectionStatusName'])) $this->ConnectionStatusName = $o['ConnectionStatusName'];
        if (isset($o['ConnectionStatusId'])) $this->ConnectionStatusId = $o['ConnectionStatusId'];
        if (isset($o['ConnectionId'])) $this->ConnectionId = $o['ConnectionId'];
        if (isset($o['ConnectionRequestId'])) $this->ConnectionRequestId = $o['ConnectionRequestId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContactRoleId)) $o['ContactRoleId'] = $this->ContactRoleId;
        if (isset($this->ContactRoleName)) $o['ContactRoleName'] = $this->ContactRoleName;
        if (isset($this->ContactListItemRoleId)) $o['ContactListItemRoleId'] = $this->ContactListItemRoleId;
        if (isset($this->ContactRolePrimaryImageURL)) $o['ContactRolePrimaryImageURL'] = $this->ContactRolePrimaryImageURL;
        if (isset($this->ContactRolePrimaryImageThumbnailURL)) $o['ContactRolePrimaryImageThumbnailURL'] = $this->ContactRolePrimaryImageThumbnailURL;
        if (isset($this->ContactRolePrimaryImageId)) $o['ContactRolePrimaryImageId'] = $this->ContactRolePrimaryImageId;
        if (isset($this->ConnectionContactId)) $o['ConnectionContactId'] = $this->ConnectionContactId;
        if (isset($this->ConnectionContactName)) $o['ConnectionContactName'] = $this->ConnectionContactName;
        if (isset($this->ConnectionContactRoleName)) $o['ConnectionContactRoleName'] = $this->ConnectionContactRoleName;
        if (isset($this->ConnectionContactRoleId)) $o['ConnectionContactRoleId'] = $this->ConnectionContactRoleId;
        if (isset($this->ConnectionContactListItemRoleId)) $o['ConnectionContactListItemRoleId'] = $this->ConnectionContactListItemRoleId;
        if (isset($this->ContactTypeName)) $o['ContactTypeName'] = $this->ContactTypeName;
        if (isset($this->ConnectionContactPhotoURL)) $o['ConnectionContactPhotoURL'] = $this->ConnectionContactPhotoURL;
        if (isset($this->IsContactLicenseeRole)) $o['IsContactLicenseeRole'] = $this->IsContactLicenseeRole;
        if (isset($this->IsConnectionLicenseeRole)) $o['IsConnectionLicenseeRole'] = $this->IsConnectionLicenseeRole;
        if (isset($this->ConnectionStatusName)) $o['ConnectionStatusName'] = $this->ConnectionStatusName;
        if (isset($this->ConnectionStatusId)) $o['ConnectionStatusId'] = $this->ConnectionStatusId;
        if (isset($this->ConnectionId)) $o['ConnectionId'] = $this->ConnectionId;
        if (isset($this->ConnectionRequestId)) $o['ConnectionRequestId'] = $this->ConnectionRequestId;
        return empty($o) ? new class(){} : $o;
    }
}

class ContactEmailAddress implements JsonSerializable
{
    public function __construct(
        /** @description The Contact Id of the contact. */
        // @ApiMember(DataType="Guid", Description="The Contact Id of the contact.", Name="ContactId", ParameterType="query")
        /** @var string */
        public string $ContactId='',

        /** @description The Contact Full Name */
        // @ApiMember(DataType="string", Description="The Contact Full Name", Name="ContactName", ParameterType="query")
        /** @var string|null */
        public ?string $ContactName=null,

        /** @description The Contact Email Address. */
        // @ApiMember(DataType="string", Description="The Contact Email Address.", Name="EmailAddress", ParameterType="query")
        /** @var string|null */
        public ?string $EmailAddress=null,

        /** @description The Contact Photo URL */
        // @ApiMember(DataType="string", Description="The Contact Photo URL", Name="ContactPhotoURL", ParameterType="query")
        /** @var string|null */
        public ?string $ContactPhotoURL=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['ContactName'])) $this->ContactName = $o['ContactName'];
        if (isset($o['EmailAddress'])) $this->EmailAddress = $o['EmailAddress'];
        if (isset($o['ContactPhotoURL'])) $this->ContactPhotoURL = $o['ContactPhotoURL'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->ContactName)) $o['ContactName'] = $this->ContactName;
        if (isset($this->EmailAddress)) $o['EmailAddress'] = $this->EmailAddress;
        if (isset($this->ContactPhotoURL)) $o['ContactPhotoURL'] = $this->ContactPhotoURL;
        return empty($o) ? new class(){} : $o;
    }
}

class UserContacts implements JsonSerializable
{
    public function __construct(
        /** @description A list of contact connections assigned to the user. */
        // @ApiMember(DataType="List<UserContactConnectionModel>", Description="A list of contact connections assigned to the user.", Name="ContactConnections", ParameterType="query")
        /** @var array<UserContactConnectionModel>|null */
        public ?array $ContactConnections=null,

        /** @description A list of connected contacts and their email addresses. */
        // @ApiMember(DataType="List<ContactEmailAddressBook>", Description="A list of connected contacts and their email addresses.", Name="EmailAddressBook", ParameterType="query")
        /** @var array<ContactEmailAddress>|null */
        public ?array $EmailAddressBook=null
    ) {
    }

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

/** @description Returns a list of licensee contacts connected to a user profile' contact. */
// @Api(Description="Returns a list of licensee contacts connected to a user profile' contact.")
class GetLicenseeConnectedContacts implements JsonSerializable
{
    public function __construct(
        /** @description The user profiles Contact Guid. Contacts connected to the user will be filted by this profiles contact ID. */
        // @ApiMember(DataType="Guid", Description="The user profiles Contact Guid. Contacts connected to the user will be filted by this profiles contact ID.", IsRequired=true, Name="ContactId", ParameterType="query")
        /** @var string */
        public string $ContactId='',

        /** @description The suite id list. Gets contacts connected to the user filted by the suite IDs in this list.. */
        // @ApiMember(DataType="List<Guid>", Description="The suite id list. Gets contacts connected to the user filted by the suite IDs in this list..", Name="SuiteIds", ParameterType="query")
        /** @var array<string>|null */
        public ?array $SuiteIds=null
    ) {
    }

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

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

POST /csv/reply/GetLicenseeConnectedContacts HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"ContactId":"00000000-0000-0000-0000-000000000000","SuiteIds":["00000000-0000-0000-0000-000000000000"]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ContactConnections":[{"ContactRoleId":"00000000-0000-0000-0000-000000000000","ContactRoleName":"String","ContactListItemRoleId":"00000000-0000-0000-0000-000000000000","ContactRolePrimaryImageURL":"String","ContactRolePrimaryImageThumbnailURL":"String","ContactRolePrimaryImageId":"00000000-0000-0000-0000-000000000000","ConnectionContactId":"00000000-0000-0000-0000-000000000000","ConnectionContactName":"String","ConnectionContactRoleName":"String","ConnectionContactRoleId":"00000000-0000-0000-0000-000000000000","ConnectionContactListItemRoleId":"00000000-0000-0000-0000-000000000000","ContactTypeName":"String","ConnectionContactPhotoURL":"String","IsContactLicenseeRole":false,"IsConnectionLicenseeRole":false,"ConnectionStatusName":"String","ConnectionStatusId":"00000000-0000-0000-0000-000000000000","ConnectionId":"00000000-0000-0000-0000-000000000000","ConnectionRequestId":"00000000-0000-0000-0000-000000000000"}],"EmailAddressBook":[{"ContactId":"00000000-0000-0000-0000-000000000000","ContactName":"String","EmailAddress":"String","ContactPhotoURL":"String"}]}