SupplierConnect Gateway API

<back to all web services

ScheduleRequest

Creates or Reschedules a SupplierConnect schedule. This will return the id of the schedule request created and the communication id of the notification sent.

Requires Authentication
The following routes are available for this service:
POST/api/schedules
PUT/api/schedules/{RequestId}
<?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 ScheduleResponse implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $ReferenceId='',
        /** @var string */
        public string $CommunicationId='',
        /** @var bool|null */
        public ?bool $Success=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string|null */
        public ?string $Payload=null
    ) {
    }

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

// @DataContract
class ObjectReference implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="RmsTableContextId")
        /** @var string */
        public string $RmsTableContextId='',

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

        // @DataMember(Name="DataSourceInstanceId")
        /** @var string */
        public string $DataSourceInstanceId=''
    ) {
    }

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

// @DataContract
class ContactInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Id")
        /** @var string */
        public string $Id='',

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['ContactReference'])) $this->ContactReference = JsonConverters::from('ObjectReference', $o['ContactReference']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->ContactReference)) $o['ContactReference'] = JsonConverters::to('ObjectReference', $this->ContactReference);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class ProjectInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Id")
        /** @var string */
        public string $Id='',

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

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

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

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

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

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

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['HouseType'])) $this->HouseType = $o['HouseType'];
        if (isset($o['Elevation'])) $this->Elevation = $o['Elevation'];
        if (isset($o['CustomerName'])) $this->CustomerName = $o['CustomerName'];
        if (isset($o['Supervisor'])) $this->Supervisor = JsonConverters::from('ContactInfo', $o['Supervisor']);
        if (isset($o['ProjectReference'])) $this->ProjectReference = JsonConverters::from('ObjectReference', $o['ProjectReference']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->HouseType)) $o['HouseType'] = $this->HouseType;
        if (isset($this->Elevation)) $o['Elevation'] = $this->Elevation;
        if (isset($this->CustomerName)) $o['CustomerName'] = $this->CustomerName;
        if (isset($this->Supervisor)) $o['Supervisor'] = JsonConverters::to('ContactInfo', $this->Supervisor);
        if (isset($this->ProjectReference)) $o['ProjectReference'] = JsonConverters::to('ObjectReference', $this->ProjectReference);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class PurchaseOrderInfo implements JsonSerializable
{
    public function __construct(
        // @DataMember(Name="Id")
        /** @var string */
        public string $Id='',

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

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

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

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['PurchaseOrderReference'])) $this->PurchaseOrderReference = JsonConverters::from('ObjectReference', $o['PurchaseOrderReference']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->PurchaseOrderReference)) $o['PurchaseOrderReference'] = JsonConverters::to('ObjectReference', $this->PurchaseOrderReference);
        return empty($o) ? new class(){} : $o;
    }
}

// @DataContract
class ActivityReference implements JsonSerializable
{
    public function __construct(
        /** @description Name/details of the activity */
        // @DataMember(Name="name")
        // @ApiMember(Description="Name/details of the activity", IsRequired=true, Name="Name")
        /** @var string */
        public string $name='',

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

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

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

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

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

enum AttachmentType : string
{
    case Url = 'Url';
    case FileStream = 'FileStream';
}

class EmailAttachment implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $FileName=null,
        /** @var string|null */
        public ?string $ContentType=null,
        /** @var string|null */
        public ?string $Path=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var int */
        public int $Length=0,
        /** @var ByteArray|null */
        public ?ByteArray $FileStream=null,
        /** @var string|null */
        public ?string $StreamContent=null,
        /** @var AttachmentType|null */
        public ?AttachmentType $AttachmentType=null,
        /** @var bool|null */
        public ?bool $ProcessedAndUploadedAsBlob=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['FileName'])) $this->FileName = $o['FileName'];
        if (isset($o['ContentType'])) $this->ContentType = $o['ContentType'];
        if (isset($o['Path'])) $this->Path = $o['Path'];
        if (isset($o['Url'])) $this->Url = $o['Url'];
        if (isset($o['Length'])) $this->Length = $o['Length'];
        if (isset($o['FileStream'])) $this->FileStream = JsonConverters::from('ByteArray', $o['FileStream']);
        if (isset($o['StreamContent'])) $this->StreamContent = $o['StreamContent'];
        if (isset($o['AttachmentType'])) $this->AttachmentType = JsonConverters::from('AttachmentType', $o['AttachmentType']);
        if (isset($o['ProcessedAndUploadedAsBlob'])) $this->ProcessedAndUploadedAsBlob = $o['ProcessedAndUploadedAsBlob'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->FileName)) $o['FileName'] = $this->FileName;
        if (isset($this->ContentType)) $o['ContentType'] = $this->ContentType;
        if (isset($this->Path)) $o['Path'] = $this->Path;
        if (isset($this->Url)) $o['Url'] = $this->Url;
        if (isset($this->Length)) $o['Length'] = $this->Length;
        if (isset($this->FileStream)) $o['FileStream'] = JsonConverters::to('ByteArray', $this->FileStream);
        if (isset($this->StreamContent)) $o['StreamContent'] = $this->StreamContent;
        if (isset($this->AttachmentType)) $o['AttachmentType'] = JsonConverters::to('AttachmentType', $this->AttachmentType);
        if (isset($this->ProcessedAndUploadedAsBlob)) $o['ProcessedAndUploadedAsBlob'] = $this->ProcessedAndUploadedAsBlob;
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Creates or Reschedules a SupplierConnect schedule. This will return the id of the schedule request created and the communication id of the notification sent. */
// @Api(Description="Creates or Reschedules a SupplierConnect schedule. This will return the id of the schedule request created and the communication id of the notification sent.")
// @DataContract
class ScheduleRequest implements JsonSerializable
{
    public function __construct(
        /** @description Id of the schedule request to be recreated */
        // @DataMember(Name="RequestId")
        // @ApiMember(Description="Id of the schedule request to be recreated", IsRequired=true, Name="RequestId")
        /** @var string */
        public string $RequestId='',

        /** @description Date/Time of the activity */
        // @DataMember(Name="ScheduleDateTime")
        // @ApiMember(Description="Date/Time of the activity", IsRequired=true, Name="ScheduleDateTime")
        // @Required()
        /** @var DateTime */
        public DateTime $ScheduleDateTime=new DateTime(),

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

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

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

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

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

        // @DataMember(Name="Params")
        /** @var array<ScheduleParams>|null */
        public ?array $Params=null,

        // @DataMember(Name="Attachments")
        /** @var array<EmailAttachment>|null */
        public ?array $Attachments=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['RequestId'])) $this->RequestId = $o['RequestId'];
        if (isset($o['ScheduleDateTime'])) $this->ScheduleDateTime = JsonConverters::from('DateTime', $o['ScheduleDateTime']);
        if (isset($o['Requester'])) $this->Requester = JsonConverters::from('ContactInfo', $o['Requester']);
        if (isset($o['Supplier'])) $this->Supplier = JsonConverters::from('ContactInfo', $o['Supplier']);
        if (isset($o['Project'])) $this->Project = JsonConverters::from('ProjectInfo', $o['Project']);
        if (isset($o['PurchaseOrder'])) $this->PurchaseOrder = JsonConverters::from('PurchaseOrderInfo', $o['PurchaseOrder']);
        if (isset($o['Activity'])) $this->Activity = JsonConverters::from('ActivityReference', $o['Activity']);
        if (isset($o['Params'])) $this->Params = JsonConverters::fromArray('ScheduleParams', $o['Params']);
        if (isset($o['Attachments'])) $this->Attachments = JsonConverters::fromArray('EmailAttachment', $o['Attachments']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->RequestId)) $o['RequestId'] = $this->RequestId;
        if (isset($this->ScheduleDateTime)) $o['ScheduleDateTime'] = JsonConverters::to('DateTime', $this->ScheduleDateTime);
        if (isset($this->Requester)) $o['Requester'] = JsonConverters::to('ContactInfo', $this->Requester);
        if (isset($this->Supplier)) $o['Supplier'] = JsonConverters::to('ContactInfo', $this->Supplier);
        if (isset($this->Project)) $o['Project'] = JsonConverters::to('ProjectInfo', $this->Project);
        if (isset($this->PurchaseOrder)) $o['PurchaseOrder'] = JsonConverters::to('PurchaseOrderInfo', $this->PurchaseOrder);
        if (isset($this->Activity)) $o['Activity'] = JsonConverters::to('ActivityReference', $this->Activity);
        if (isset($this->Params)) $o['Params'] = JsonConverters::toArray('ScheduleParams', $this->Params);
        if (isset($this->Attachments)) $o['Attachments'] = JsonConverters::toArray('EmailAttachment', $this->Attachments);
        return empty($o) ? new class(){} : $o;
    }
}

PHP ScheduleRequest 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/schedules HTTP/1.1 
Host: production-eros-gateway-api-supplierconnect.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ScheduleRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Dvaravartman.SupplierConnect.Model.APIModels">
  <Activity>
    <name>String</name>
    <notes>String</notes>
  </Activity>
  <Attachments xmlns:d2p1="http://schemas.datacontract.org/2004/07/Eros.Saguna.Common.Library">
    <d2p1:EmailAttachment>
      <d2p1:AttachmentType>Url</d2p1:AttachmentType>
      <d2p1:ContentType>String</d2p1:ContentType>
      <d2p1:FileName>String</d2p1:FileName>
      <d2p1:FileStream xmlns:d4p1="http://schemas.datacontract.org/2004/07/System.IO" i:nil="true" />
      <d2p1:Length>0</d2p1:Length>
      <d2p1:Path>String</d2p1:Path>
      <d2p1:ProcessedAndUploadedAsBlob>false</d2p1:ProcessedAndUploadedAsBlob>
      <d2p1:StreamContent>String</d2p1:StreamContent>
      <d2p1:Url>String</d2p1:Url>
    </d2p1:EmailAttachment>
  </Attachments>
  <Params>
    <ScheduleParams>
      <Name>String</Name>
      <Value>String</Value>
    </ScheduleParams>
  </Params>
  <Project>
    <Address>String</Address>
    <CustomerName>String</CustomerName>
    <Description>String</Description>
    <Elevation>String</Elevation>
    <HouseType>String</HouseType>
    <Id>00000000-0000-0000-0000-000000000000</Id>
    <Name>String</Name>
    <ProjectReference>
      <AlternateKey>String</AlternateKey>
      <DataSourceInstanceId>00000000-0000-0000-0000-000000000000</DataSourceInstanceId>
      <RmsTableContextId>00000000-0000-0000-0000-000000000000</RmsTableContextId>
    </ProjectReference>
    <Reference>String</Reference>
    <Supervisor>
      <ContactReference>
        <AlternateKey>String</AlternateKey>
        <DataSourceInstanceId>00000000-0000-0000-0000-000000000000</DataSourceInstanceId>
        <RmsTableContextId>00000000-0000-0000-0000-000000000000</RmsTableContextId>
      </ContactReference>
      <Email>String</Email>
      <Id>00000000-0000-0000-0000-000000000000</Id>
      <Name>String</Name>
      <Phone>String</Phone>
    </Supervisor>
  </Project>
  <PurchaseOrder>
    <Description>String</Description>
    <Id>00000000-0000-0000-0000-000000000000</Id>
    <PurchaseOrderReference>
      <AlternateKey>String</AlternateKey>
      <DataSourceInstanceId>00000000-0000-0000-0000-000000000000</DataSourceInstanceId>
      <RmsTableContextId>00000000-0000-0000-0000-000000000000</RmsTableContextId>
    </PurchaseOrderReference>
    <Reference>String</Reference>
  </PurchaseOrder>
  <RequestId>00000000-0000-0000-0000-000000000000</RequestId>
  <Requester>
    <ContactReference>
      <AlternateKey>String</AlternateKey>
      <DataSourceInstanceId>00000000-0000-0000-0000-000000000000</DataSourceInstanceId>
      <RmsTableContextId>00000000-0000-0000-0000-000000000000</RmsTableContextId>
    </ContactReference>
    <Email>String</Email>
    <Id>00000000-0000-0000-0000-000000000000</Id>
    <Name>String</Name>
    <Phone>String</Phone>
  </Requester>
  <ScheduleDateTime>0001-01-01T00:00:00</ScheduleDateTime>
  <Supplier>
    <ContactReference>
      <AlternateKey>String</AlternateKey>
      <DataSourceInstanceId>00000000-0000-0000-0000-000000000000</DataSourceInstanceId>
      <RmsTableContextId>00000000-0000-0000-0000-000000000000</RmsTableContextId>
    </ContactReference>
    <Email>String</Email>
    <Id>00000000-0000-0000-0000-000000000000</Id>
    <Name>String</Name>
    <Phone>String</Phone>
  </Supplier>
</ScheduleRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ScheduleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Dvaravartman.SupplierConnect.Model.APIModels">
  <CommunicationId>00000000-0000-0000-0000-000000000000</CommunicationId>
  <Message>String</Message>
  <Payload>String</Payload>
  <ReferenceId>00000000-0000-0000-0000-000000000000</ReferenceId>
  <Success>false</Success>
</ScheduleResponse>