Whups external API interface.
This file defines Whups' external API interface. Other applications
can interact with Whups through this API.
Methods summary
public
array
|
#
browse( string $path = '' )
Browse through Whups' object tree.
Browse through Whups' object tree.
Parameters
- $path
- The level of the tree to browse.
Returns
array The contents of $path
|
public
integer
|
#
addQueue( string $name )
Create a new queue.
Parameters
Returns
integer The new queue id.
|
public
array
|
#
getAssignedTicketIds( )
Return the ids of all open tickets assigned to the current user.
Return the ids of all open tickets assigned to the current user.
Returns
array Array of ticket ids.
|
public
array
|
#
getRequestedTicketIds( )
Return the ids of all open tickets that the current user created.
Return the ids of all open tickets that the current user created.
Returns
array Array of ticket ids.
|
public
integer
|
#
addTicket( array $ticket_info )
Create a new ticket.
Parameters
- $ticket_info
- <p>An array of form variables representing all of the
data collected by CreateStep1Form, CreateStep2Form, CreateStep3Form, and
optionally CreateStep4Form.</p>
Returns
integer The new ticket id.
|
public
boolean
|
#
updateTicket( integer $ticket_id, array $ticket_info )
Update a ticket's properties.
Update a ticket's properties.
Parameters
- $ticket_id
- The id of the id to changes.
- $ticket_info
- The attributes to set, from the EditTicketForm.
Returns
boolean True
|
public
|
#
addAttachment( integer $ticket_id, string $name, string $data )
Adds an attachment to a ticket.
Adds an attachment to a ticket.
Parameters
- $ticket_id
- The ticket number.
- $name
- The name of the attachment.
- $data
- The attachment data.
Throws
|
public
|
|
public
array
|
#
getListTypes( )
Get the types that Whups items can be listed as.
Get the types that Whups items can be listed as.
Returns
array Array of list types.
|
public
array
|
#
listAs( string $type )
Get a list of items from whups as type $type.
Get a list of items from whups as type $type.
Parameters
- $type
- The list type to use (@see getListTypes). Currently supported: 'taskHash'
Returns
array An array of tickets.
|
public
array
|
#
listQueues( )
Return a list of queues that the current user has read permissions for
Return a list of queues that the current user has read permissions for
Returns
array Array of queue details
|
public
array
|
#
listSlugs( )
Return a list of slugs that the current user has read permissions for
Return a list of slugs that the current user has read permissions for
Returns
array Array of queue details
|
public
array
|
#
getQueueDetails( array $queue )
Get details for a queue
Parameters
- $queue
- integer $queue Either an array of queue ids or a single queue id.
Returns
array An array of queue information (or an array of arrays, if multiple queues were passed).
|
public
array
|
#
listVersions( integer $queue )
List the versions associated with a queue
List the versions associated with a queue
Parameters
- $queue
- The queue id to get versions for.
Returns
array Array of queue versions
|
public
|
#
addVersion( integer $queue, string $name, string $description, boolean $active = true )
Add a version to a queue
Parameters
- $queue
- The queue id to add the version to.
- $name
- The name of the new version.
- $description
- The descriptive text for the new version.
- $active
- Whether the version is still active.
|
public
array
|
#
getVersionDetails( integer $version_id )
Return the details for a queue version
Return the details for a queue version
Parameters
- $version_id
- The version to fetch
Returns
array Array of version details
|
public
array
|
#
getTicketDetails( integer $queue_id, string $state = null )
Get the all tickets for a queue, optionally with a specific state.
Get the all tickets for a queue, optionally with a specific state.
Parameters
- $queue_id
- The queue to get tickets for
- $state
- The state filter, if any.
Returns
array Array of tickets
|
public
array
|
#
listCostObjects( array $criteria )
List cost objects
Parameters
- $criteria
- The list criteria
Returns
array Tickets (as cost objects) matching $criteria
|
public
array
|
#
listTimeObjectCategories( )
List the ways that tickets can be treated as time objects
List the ways that tickets can be treated as time objects
Returns
array Array of time object types
|
public
|
#
listTimeObjects( array $categories, mixed $start, mixed $end )
Lists tickets with due dates as time objects.
Lists tickets with due dates as time objects.
Parameters
- $categories
- The time categories (from listTimeObjectCategories) to list.
- $start
- The start date of the period.
- $end
- The end date of the period.
|