silktide/freshdesk-api

This package is abandoned and no longer maintained. No replacement package was suggested.

PHP API library for Freshdesk

0.1.1 2015-12-02 16:39 UTC

This package is not auto-updated.

Last update: 2020-01-20 21:27:26 UTC


README

Build Status Code Climate Test Coverage

A PHP API client for the Freshdesk API.

Installation

composer require silktide/freshdesk-api

Usage

This library was built with dependency injection (DI) in mind, but a factory is included for your convenience should you prefer.

With DI

The client class has 5 dependencies:

  1. Instance of GuzzleHttp\Client
  2. Instance of Silktide\FreshdeskApi\ResponseFactory
  3. Your Freshdesk domain (e.g. 'https://mydomain.freshdesk.com')
  4. Your API key or username
  5. Your password (optional, omit if using API key)

Without DI

$client = \Silktide\FreshdeskApi\ClientFactory::create('https://mydomain.freshdesk.com', 'myApiKeyOrUsername', 'password');

Password is optional and should be omitted if you're using an API key.

Supported requests

Currently, this library only supports submitting a ticket.

$client->submitTicket(
    'A message',
    'A subject',
    'email@domain.com',
    \Silktide\FreshdeskApi\Constant::PRIORITY_MEDIUM, // Defaults to low if omitted
    \Silktide\FreshdeskApi\Constant::STATUS_OPEN // Defaults to open if omitted
);