Properties

$moxi_works_agent_id

$moxi_works_agent_id : string

Type

string — the Moxi Works Platform ID of the agent moxi_works_agent_id is the Moxi Works Platform ID of the agent which a task is or is to be associated with. this must be set for any Moxi Works Platform transaction

$partner_contact_id

$partner_contact_id : string

Type

string — your system's unique ID for the contact *your system's* unique ID for the Contact associated with this Task this must be set for any Moxi Works Platform transaction

$partner_task_id

$partner_task_id : string

Type

string — your system's unique ID for the task *your system's* unique ID for the Task this must be set for any Moxi Works Platform transaction

$name

$name : string

Type

string — -- Default '' the title to be displayed for this task

$description

$description : string

Type

string — -- Default '' a description of this task (max 255 characters)

$due_at

$due_at : integer

Type

integer — the Unix timestamp representing the due date of this Task this must be set when creating or updating a Task

$status

$status : \MoxiworksPlatform\string,

Type

\MoxiworksPlatform\string, — Enumerated -- 'active' or 'completed' -- Default 'active' the status of this task. allowed values: active completed [nil] When creating a new task, the assumed state is 'active;' this attribute does not need to be populated when creating or updating a Task unless the status is 'completed.'

$created_at

$created_at : integer

Type

integer — the Unix timestamp representing the creation date of this Task this is a read-only attribute which gets set automatically on creation of the task in the Moxi Works Platform

$completed_at

$completed_at : integer

Type

integer — the Unix timestamp representing the completion date of this Task When the task is not in a 'completed' state, this attribute will be nil. When updating the <i>completed_at</i> attribute, the <i>status</i> attribute must be set to <b>completed</b>

$duration

$duration : integer

Type

integer — the time (in minutes) that the task is expected to take to complete

Methods

headers()

headers() 

authHeader()

authHeader() 

acceptHeader()

acceptHeader() 

contentTypeHeader()

contentTypeHeader() 

userAgentHeader()

userAgentHeader() 

apiConnection()

apiConnection(  $method,   $url,   $attributes) 

Parameters

$method
$url
$attributes

checkForErrorInResponse()

checkForErrorInResponse(  $json) 

Parameters

$json

underscore()

underscore(  $attr) 

Parameters

$attr

__construct()

__construct(array  $data) 

Task constructor.

Parameters

array $data

create()

create(array  $attributes = array()) : \MoxiworksPlatform\Task|null

Create a Task on The Moxi Works Platform <code> MoxiworksPlatform\Task::create([ moxi_works_agent_id: '123abc', partner_contact_id: '1234', partner_task_id: 'mySystemsTaskID', name: 'pick up keys', description: 'pick up keys from 1234 there ave', due_at: 1463595006, duration: 30]); </code>

Parameters

array $attributes

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Task|null

update()

update(array  $attributes = array()) : \MoxiworksPlatform\Task|null

Update a previously created Task on The Moxi Works Platform <code> MoxiworksPlatform\Task::update([ moxi_works_agent_id: '123abc', partner_contact_id: '1234', partner_task_id: 'mySystemsTaskID', name: 'pick up keys', description: 'pick up keys from 1234 there ave', due_at: 1463595006, duration: 30, status: 'completed', completed_at: 1463598765]); </code>

Parameters

array $attributes

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Task|null

find()

find(array  $attributes = array()) : \MoxiworksPlatform\Task|null

Find a previously created Task on Moxi Works Platform.

find can be performed including your system's task id and the Moxi Works Agent ID in a parameter array \MoxiworksPlatform\Task::find([moxi_works_agent_id: 'abc123', partner_task_id: 'my_system_task_id'])

Parameters

array $attributes


moxi_works_agent_id REQUIRED The Moxi Works Agent ID for the agent to which this task is to be associated
partner_task_id REQUIRED Your system's unique ID for this task.

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Task|null

search()

search(array  $attributes = array()) : Array

Search for Tasks between start/end date on Moxi Works Platform.

search can be performed by including due_date_start and due_date_end in a parameter array \MoxiworksPlatform\Task::search([moxi_works_agent_id: 'abc123', date_start: 1463595006, date_end: 1463599996])

Parameters

array $attributes


moxi_works_agent_id REQUIRED string The Moxi Works Agent ID for the agent to which this task is associated
date_start REQUIRED integer Unix timestamp representing the start time for the search
date_end REQUIRED integer Unix timestamp representing the end time for the search

  <h2>
optional Task search parameters


partner_contact_id your system's ID for a specific contact for whom tasks are to be returned
page_number page number of responses to return (if number of responses spans a beyond a single page of responses)

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\Exception\ArgumentException

if at least one search parameter is not defined

\MoxiworksPlatform\RemoteRequestFailureException

Returns

Array —

paged response array with the format: [ page_number: [Integer], total_pages: [Integer], tasks: [Array] containing MoxiworkPlatform\Task objects ]

save()

save() : \MoxiworksPlatform\Task|null

Save Task to Moxi Works Platform

$task = MoxiworksPlatform\Task::find([ moxi_works_agent_id: '123abc']); $task->search_city = 'Cityville'; $task->save();

Returns

\MoxiworksPlatform\Task|null

sendRequest()

sendRequest(  $method, array  $opts = array(), null  $url = null) : \MoxiworksPlatform\Task|null

Parameters

$method
array $opts
null $url

Throws

\MoxiworksPlatform\Exception\ArgumentException

if required parameters are not included

\MoxiworksPlatform\RemoteRequestFailureException

Returns

\MoxiworksPlatform\Task|null