Support integrations

Get departments

getDepartments()

Should return all available support departments from the ticket software. Gets used for the mapping dropdown in the administration (see testing)

Parameters

None

Response

Collection of TicketDepartmentResponse()

Type

Name

Description

string

$id

The technical ID of the department.

string

$name

The display name of the department

Example Code

public function getDepartments(): Collection {
	$response = $this->makeRequest("mailboxes");
	$result = collect();

	foreach ($response->_embedded->mailboxes as $mailbox) {
		$result->add(new TicketDepartmentResponse($mailbox->id, $mailbox->name));
	}

	return $result;
}

Testing

Visit Settings -> Support settings -> Provider Settings in the administration. When entering your api key, a dropdown of all departments will be fetched using the above method.

Was this helpful?