Download the PHP package gostellarco/nylas-php without Composer

On this page you can find all versions of the php package gostellarco/nylas-php. 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 nylas-php

Nylas PHP SDK

Build Code Quality Packagist Version (including pre-releases) Packagist Stars Total Downloads Packagist PHP Version Support License

PHP bindings for the Nylas REST API (V2.1). https://docs.nylas.com/reference
I'll try to keep up with NyLas Changelog in future updates.

Last check at the point: Dashboard Release for Canada and Ireland

What's new?

  1. API 2.1 support
  2. All Nylas APIs have been implemented within this SDK.
  3. Support send & get message in raw type
  4. Support async batch upload & download
    -- Contact picture download
    -- File upload & download
  5. The parameters that required by methods almost the same as nylas official api required.
  6. Support async batch get & delete & send (since version 3.1).
  7. Chained calls and good code hints, easy to use

Installation (PHP 7.4 required since version 4.0)

version 3.x for php >= 7.3 (branch 3.0)

version 4.x for php >= 7.4 (branch master)

This library is available on https://packagist.org/packages/lanlin/nylas-php
You can install it by running

Usage

App ID and Secret

Before you can interact with the Nylas REST API,
you need to create a Nylas developer account at https://www.nylas.com/.
After you've created a developer account, you can create a new application to generate an App ID / Secret pair.

Generally, you should store your App ID and Secret into environment variables to avoid adding them to source control.
The test projects use configuration files instead, to make it easier to get started.

Init Nylas-PHP

TIPS: 'off_decode_error' has removed since version 4.1.2, see Error & Exceptions

Options Setting

You can modify options with these methods:

Batch Request

Most of the methods that have the get & delete prefix support batch request.

For more detail about the batch request, you should have to read the source code.
Sorry, I have no time to write documents.

Authentication

There are two ways you can authenticate users to your application.
Hosted & Native are both supported.

Here's the server-side(three-legged) OAuth example:

  1. You redirect the user to nylas login page, along with your App Id and Secret
  2. Your user logs in
  3. She is redirected to a callback URL of your own, along with an access code
  4. You use this access code to get an authorization token to the API

For more information about authenticating with Nylas,
visit the Developer Documentation.

In practice, the Nylas REST API client simplifies this down to two steps.

Step 1: Redirect the user to Nylas:

Step 2: your user logs in:
Step 3: you got the access code from the nylas callback:
Please implement the above 2 & 3 steps yourself.

Step 4: Get authorization token with access code:

Error & Exceptions

  1. common error codes that response from nylas are wrapped as exceptions, (see src/Exceptions) and the exception code is the same as nylas api error list

  2. you will get an array like below, when response data was not a valid json string or even not json content type:

  3. for all methods that execute as the async mode will not throw an exception when an error occurs, instead, it will return an array which contains all data and exceptions inside like below:

  4. some email provider may not support all features, exp: calendar, event. for that reason you may get an exception named BadRequestException with 400 code and the msg:

  5. the log_file parameter only works when debug set to true, then the detailed info of the http request will be logged.

    Tips: nylas-php use the guzzlehttp for http request. but guzzlehttp only support a resource type as the debug handler (cURL CURLOPT_STDERR required that).

    for anyone who wants to use psr/log interface to debug, you can init a temp resource, and pass the handler to nylas-php, then get log content from temp resource after calling some methods.

Launching the tests

  1. Initialise composer dependency composer install
  2. Add your info in tests/AbsCase.php
  3. Launch the test with composer run-script test
  4. Another way to run tests: ./tests/do.sh foo.php --filter fooMethod, see tests/do.sh

Supported Methods

The parameters that required by methods almost the same as nylas official api required.

For more detail, you can view the tests or the source code of validation rules for that method.

Accounts

Authentication

Calendars

Contacts

Deltas

Draft

Events

Files

Folders

Labels

Job-Statuses

Messages

Threads

Webhooks

Contributing

For more usage demos, please view the tests.
Please feel free to use it and send me a pull request if you fix anything or add a feature, though.

License

This project is licensed under the MIT license.


All versions of nylas-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
guzzlehttp/guzzle Version >=6.5
respect/validation Version ^2.0
zbateson/mail-mime-parser Version ^1.2
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 gostellarco/nylas-php contains the following files

Loading the files please wait ....