<back to all web services

GetAnalyticsAccountsMessage

The following routes are available for this service:
All Verbs/RestApi/Sitefinity/Analytics/GetAnalyticsAccounts
All Verbs/RestApi/GetAnalyticsAccounts
<?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 GetAnalyticsAccountsMessage implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $SiteId=''
    ) {
    }

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

// @DataContract
class AnalyticsAccountInfo implements IGoogleAnalyticsProviderConfiguration, JsonSerializable
{
    public function __construct(
        // @DataMember(Name="id")
        /** @var string|null */
        public ?string $id=null,

        // @DataMember(Name="accountId")
        /** @var string|null */
        public ?string $accountId=null,

        // @DataMember(Name="name")
        /** @var string|null */
        public ?string $name=null,

        // @DataMember(Name="webPropertyId")
        /** @var string|null */
        public ?string $webPropertyId=null
    ) {
    }

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

class GetAnalyticsAccountsData implements JsonSerializable
{
    public function __construct(
        /** @var array<AnalyticsAccountInfo>|null */
        public ?array $Accounts=null,
        /** @var string|null */
        public ?string $SelectedAccount=null,
        /** @var string|null */
        public ?string $SelectedProfileId=null
    ) {
    }

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

PHP GetAnalyticsAccountsMessage 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 /RestApi/Sitefinity/Analytics/GetAnalyticsAccounts HTTP/1.1 
Host: www.asg.com.au 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<GetAnalyticsAccountsMessage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Telerik.Sitefinity.Analytics.Server.Infrastructure.Services.ServiceStackServices.Model">
  <SiteId>00000000-0000-0000-0000-000000000000</SiteId>
</GetAnalyticsAccountsMessage>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetAnalyticsAccountsData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Telerik.Sitefinity.Analytics.Server.Infrastructure.Services.ServiceStackServices.Model">
  <Accounts xmlns:d2p1="http://schemas.datacontract.org/2004/07/Telerik.Sitefinity.Analytics.Server.Core.Domain.Model">
    <d2p1:AnalyticsAccountInfo>
      <d2p1:accountId>String</d2p1:accountId>
      <d2p1:id>String</d2p1:id>
      <d2p1:name>String</d2p1:name>
      <d2p1:webPropertyId>String</d2p1:webPropertyId>
    </d2p1:AnalyticsAccountInfo>
  </Accounts>
  <SelectedAccount>String</SelectedAccount>
  <SelectedProfileId>String</SelectedProfileId>
</GetAnalyticsAccountsData>