regis

<back to all web services

CRMActivityCreateRequest

Requires Authentication
Required role:REGISUserRole
The following routes are available for this service:
POST/DynamicsCRM/Activity/Create
<?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 CRMActivityCreateRequest implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $regent_id=0,
        /** @var string|null */
        public ?string $lead_guid=null,
        /** @var int|null */
        public ?int $import_id=null,
        /** @var string|null */
        public ?string $subject=null,
        /** @var string|null */
        public ?string $description=null,
        /** @var string|null */
        public ?string $phone_email=null,
        /** @var array<string>|null */
        public ?array $email_cc=null,
        /** @var string|null */
        public ?string $gmail_thread_index=null,
        /** @var string|null */
        public ?string $related_username=null,
        /** @var DateTime|null */
        public ?DateTime $scheduled_start=null,
        /** @var DateTime|null */
        public ?DateTime $scheduled_end=null,
        /** @var string|null */
        public ?string $event_location=null,
        /** @var string|null */
        public ?string $event_type=null,
        /** @var string|null */
        public ?string $event_participation=null,
        /** @var bool|null */
        public ?bool $is_completed=null,
        /** @var bool|null */
        public ?bool $is_contact=null,
        /** @var bool|null */
        public ?bool $is_lead=null,
        /** @var bool|null */
        public ?bool $is_account=null,
        /** @var bool|null */
        public ?bool $is_email=null,
        /** @var bool|null */
        public ?bool $is_letter=null,
        /** @var bool|null */
        public ?bool $is_phonecall=null,
        /** @var bool|null */
        public ?bool $is_task=null,
        /** @var bool|null */
        public ?bool $is_meeting=null,
        /** @var bool|null */
        public ?bool $is_event=null,
        /** @var DateTime|null */
        public ?DateTime $date_of_occurrence=null,
        /** @var DateTime|null */
        public ?DateTime $added_date=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['regent_id'])) $this->regent_id = $o['regent_id'];
        if (isset($o['lead_guid'])) $this->lead_guid = $o['lead_guid'];
        if (isset($o['import_id'])) $this->import_id = $o['import_id'];
        if (isset($o['subject'])) $this->subject = $o['subject'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['phone_email'])) $this->phone_email = $o['phone_email'];
        if (isset($o['email_cc'])) $this->email_cc = JsonConverters::fromArray('string', $o['email_cc']);
        if (isset($o['gmail_thread_index'])) $this->gmail_thread_index = $o['gmail_thread_index'];
        if (isset($o['related_username'])) $this->related_username = $o['related_username'];
        if (isset($o['scheduled_start'])) $this->scheduled_start = JsonConverters::from('DateTime', $o['scheduled_start']);
        if (isset($o['scheduled_end'])) $this->scheduled_end = JsonConverters::from('DateTime', $o['scheduled_end']);
        if (isset($o['event_location'])) $this->event_location = $o['event_location'];
        if (isset($o['event_type'])) $this->event_type = $o['event_type'];
        if (isset($o['event_participation'])) $this->event_participation = $o['event_participation'];
        if (isset($o['is_completed'])) $this->is_completed = $o['is_completed'];
        if (isset($o['is_contact'])) $this->is_contact = $o['is_contact'];
        if (isset($o['is_lead'])) $this->is_lead = $o['is_lead'];
        if (isset($o['is_account'])) $this->is_account = $o['is_account'];
        if (isset($o['is_email'])) $this->is_email = $o['is_email'];
        if (isset($o['is_letter'])) $this->is_letter = $o['is_letter'];
        if (isset($o['is_phonecall'])) $this->is_phonecall = $o['is_phonecall'];
        if (isset($o['is_task'])) $this->is_task = $o['is_task'];
        if (isset($o['is_meeting'])) $this->is_meeting = $o['is_meeting'];
        if (isset($o['is_event'])) $this->is_event = $o['is_event'];
        if (isset($o['date_of_occurrence'])) $this->date_of_occurrence = JsonConverters::from('DateTime', $o['date_of_occurrence']);
        if (isset($o['added_date'])) $this->added_date = JsonConverters::from('DateTime', $o['added_date']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->regent_id)) $o['regent_id'] = $this->regent_id;
        if (isset($this->lead_guid)) $o['lead_guid'] = $this->lead_guid;
        if (isset($this->import_id)) $o['import_id'] = $this->import_id;
        if (isset($this->subject)) $o['subject'] = $this->subject;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->phone_email)) $o['phone_email'] = $this->phone_email;
        if (isset($this->email_cc)) $o['email_cc'] = JsonConverters::toArray('string', $this->email_cc);
        if (isset($this->gmail_thread_index)) $o['gmail_thread_index'] = $this->gmail_thread_index;
        if (isset($this->related_username)) $o['related_username'] = $this->related_username;
        if (isset($this->scheduled_start)) $o['scheduled_start'] = JsonConverters::to('DateTime', $this->scheduled_start);
        if (isset($this->scheduled_end)) $o['scheduled_end'] = JsonConverters::to('DateTime', $this->scheduled_end);
        if (isset($this->event_location)) $o['event_location'] = $this->event_location;
        if (isset($this->event_type)) $o['event_type'] = $this->event_type;
        if (isset($this->event_participation)) $o['event_participation'] = $this->event_participation;
        if (isset($this->is_completed)) $o['is_completed'] = $this->is_completed;
        if (isset($this->is_contact)) $o['is_contact'] = $this->is_contact;
        if (isset($this->is_lead)) $o['is_lead'] = $this->is_lead;
        if (isset($this->is_account)) $o['is_account'] = $this->is_account;
        if (isset($this->is_email)) $o['is_email'] = $this->is_email;
        if (isset($this->is_letter)) $o['is_letter'] = $this->is_letter;
        if (isset($this->is_phonecall)) $o['is_phonecall'] = $this->is_phonecall;
        if (isset($this->is_task)) $o['is_task'] = $this->is_task;
        if (isset($this->is_meeting)) $o['is_meeting'] = $this->is_meeting;
        if (isset($this->is_event)) $o['is_event'] = $this->is_event;
        if (isset($this->date_of_occurrence)) $o['date_of_occurrence'] = JsonConverters::to('DateTime', $this->date_of_occurrence);
        if (isset($this->added_date)) $o['added_date'] = JsonConverters::to('DateTime', $this->added_date);
        return empty($o) ? new class(){} : $o;
    }
}

PHP CRMActivityCreateRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /DynamicsCRM/Activity/Create HTTP/1.1 
Host: data.regent-college.edu 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"regent_id":0,"lead_guid":"String","import_id":0,"subject":"String","description":"String","phone_email":"String","email_cc":["String"],"gmail_thread_index":"String","related_username":"String","scheduled_start":"0001-01-01T00:00:00.0000000","scheduled_end":"0001-01-01T00:00:00.0000000","event_location":"String","event_type":"String","event_participation":"String","is_completed":false,"is_contact":false,"is_lead":false,"is_account":false,"is_email":false,"is_letter":false,"is_phonecall":false,"is_task":false,"is_meeting":false,"is_event":false,"date_of_occurrence":"0001-01-01T00:00:00.0000000","added_date":"0001-01-01T00:00:00.0000000"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}