Download the PHP package adambalan/helpscout-api without Composer

On this page you can find all versions of the php package adambalan/helpscout-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package helpscout-api

Helpscout API Library (PHP 7.1+)

Build Status Packagist [Maintenance]() [Made With Love]()

The core purpose of this library is to manage Helpscout API. I built this as a separate tool for my company to be able to backup our documentation.

ATTN!!

I am currently flushing this out with more endpoints as time goes on to make this more of a useful tool.

Installing

composer install adambalan/helpscout-api

API's

All of the core API endpoint classes live under /Api/Get/.

All of them take a GuzzleHttp client and a ApiKey Contract.

Contracts

The contracts are interfaces which are basic value objects - get/set methods based on what the api at this time needs, the following contracts exist:

These are implemented and then passed to the Endpoint class methods where needed.

For further documentation see the generated documentation.

Examples

The core thing to understand is that the structure and flow goes like this:

You can also get Articles through the collections:

Articles Will return a list of articles, unfortunately you have to use the article ID to get specific information like text from a single article.

Get All Articles

To get all articles you must have a category id, which you can get from getting all categories, which in turn, requires a collection id.

Get All Articles with params

Post an article

The same concept will work for posting a category or collection, just swap out the ArticlePostBody for the Category or Collection post body contract.

Delete an article

These concepts apply to categories and collections as well.

You can view the tests to get a better understanding of how you would use the endpoints.

Update an article

ATTN!!

You can only update articles at this time.

Updating an article works the same way as creating an article with one minor difference, we pass an ArticlePutBody contract.

This contract contains three methods: id(string $articleId), getId(): string, articlePostBody(ArticlePostBody $articlePostBody)

There is one final method, the createPutBody() which is used to create the actual JSON for the request.

Much like the create, you can update a single, async and return a update request, all of which use PUT requests.

Request Async and Pools

ATTN!!

Currently this only works with articles and categories

When you want to do things in an async matter or you have an undefined amount of entities to post to a particular endpoint you can use the createAsync and createRequest. One will return a Promise and the other is intended to be used with Guzzels Pools;

Lets look at how you might do that.

createAsync()

As we can see createAsync() simply returns a promise.

createRequest()

Create request is meant to be used with the contract RequestPool to set the requests, as this method only returns a request object. You then set the requests to the pool array and then pass the RequestPool instance to the Pool class method pool, along with the client instance to the instantiation.

From there you call pool with a rejected call back function and an optional success callback function.

ATTN!!

If concurrency is not set or is less then or equal to 0, we will set the default to 20.

Dealing with responses

Helpscout doesn't return a response body with JSON about created objects, instead a lot of the information you might want are in the header, on piece of information that is important, at least when you create new resources, is the location and the id of the resource.

See class docs for Response


All versions of helpscout-api with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package adambalan/helpscout-api contains the following files

Loading the files please wait ....