Giter VIP home page Giter VIP logo

nylas-php's Introduction

nylas-php's People

Contributors

christhompsontldr avatar ejunker avatar grummfy avatar jacekandrzejewski avatar jeremygriffin avatar lanlin avatar luisvdbk-c avatar olamm2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nylas-php's Issues

Support for more variables for Availability

I realized that some of the options I needed when querying the Availability-endpoint at Nylas was missing. Specifically I needed the roound_robin-functionality as well as wanted to be able to query by calendarID's and not only by email.

Did a small update that works fine in our project and thought it might be useful for others?
A PR has been created (Add support for more Availability options #49) to look at. I hope it is ok.

Issue with mailbox connections / malformed requests.

Thanks again for the great librairy, it works like a charm and is easy to use.

I am having an issue with a few emails send for a very small number of mailboxes that keep receiving error 400: 1 - Malformed or missing a required parameter, or your email provider not support this.

After speaking with Nylas, they suggested that the SDK was sending malformed requests. I'm unsure why.

Here is the logs for this request:
Screen Shot 2022-07-06 at 4 35 27 PM

Do you know where could this be coming from?
What should I do to find the source of this issue?

Many thanks for your support.

Is there a method for upgrade and downgrade?

While I have been able to use this SDK for pretty much everything, I have not been able to find the methods for the following calls :

curl -X POST -u YOUR_APP_SECRET https://api.nylas.com/a/YOUR_APP_ID/accounts/ACCOUNT_ID/downgrade
curl -X POST -u YOUR_APP_SECRET https://api.nylas.com/a/YOUR_APP_ID/accounts/ACCOUNT_ID/upgrade

This is something I need to do as per Nylas recommendations:

Workflow 1: Stopped Status Reauth Workflow

With account sync_status webhooks enabled, you can easily re-start sync on any account using the guide below.

Step 1: Restart Sync

When you get a Stopped Sync status, create automation to immediately restart the customer's sync.  NOTE: We only keep logs for 2 weeks, so it's important we are made aware asap if reauth and troubleshooting do not solve a stopped sync. 
You can use the code below or read more about it here/

curl -X POST -u YOUR_APP_SECRET https://api.nylas.com/a/YOUR_APP_ID/accounts/ACCOUNT_ID/downgrade
curl -X POST -u YOUR_APP_SECRET https://api.nylas.com/a/YOUR_APP_ID/accounts/ACCOUNT_ID/upgrade

Is this implemented in the SDK?

Thank you for the great support.

Best,

Error handling for SSL expiry

Hi,
This is perhaps a little unusual, but the Nylas SSL certificate has expired: https://ireland.dashboard.nylas.com. They are working to fix it, but in the meantime, we are receiving an exception from the library:
{"code":999,"error":"cURL error 60: SSL certificate problem: certificate has expired (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)","trace":"#0 //shared/vendor/lanlin/nylas-php/src/Calendars/Calendar.php(68): Nylas\\Request\\Sync->get()\n#1, ... . Is there any better way this could be handled?

image

Why is the tracking option always returning 403 Error?

Hi Lanlin, first, thank you for your awesome sdk. very helpful.

I'm trying to send an email via nylas with tracking options turned on.
I have configured all the webhooks on nylas and I'm still on dev mode.

If I'm sending an email WITHOUT tracking, then it works:

        $params = [
            'to' => [
                [
                  'email' => $to,
                  'name' => $name,
                ],
            ],
            'body' => $message,
            'subject' => $subject,
        ];

        return $this->nylas->Messages()->Sending()->sendDirectly($params);

However, if I'm enabling tracking it always fail:

        $params = [
            'to' => [
                [
                  'email' => $to,
                  'name' => $name,
                ],
            ],
            'tracking' => [
                'links' => false,
                'opens' => true,
                'thread_replies' => true,
            ],
            'body' => $message,
            'subject' => $subject,
        ];

        return $this->nylas->Messages()->Sending()->sendDirectly($params);

I'm getting a 403 error with the following message:

Includes authentication errors, blocked developer applications, and cancelled accounts.

Any idea why is this happening?

Thank you

$client->Files()->File()->uploadFile() does not return uploaded file object

$params = [
            'contents' => $tmpFilePath,
            'filename' => basename($tmpFilePath),
        ];

$resp = $this->client->Files()->File()->uploadFile($params);

But all I get back in response is the same $params array which was passed in.

I've checked the nylas account logs and a successful (Http Response = 200) API call was made to the API ...

Thanks

Can we expose the raw statusCode when there is error happen during api call?

I know nylas have some predefined status code.

const StatusExceptions =
    [
        202 => Exceptions\NotReadyException::class,
        400 => Exceptions\BadRequestException::class,
        401 => Exceptions\UnauthorizedException::class,
        402 => Exceptions\RequestFailedException::class,
        403 => Exceptions\ForbiddenException::class,
        404 => Exceptions\NotFoundException::class,
        405 => Exceptions\MethodNotAllowedException::class,
        410 => Exceptions\GoneException::class,
        418 => Exceptions\TeapotException::class,
        422 => Exceptions\SendingErrorException::class,
        429 => Exceptions\TooManyRequestsException::class,
        500 => Exceptions\ServerErrorException::class,
        502 => Exceptions\ServerErrorException::class,
        503 => Exceptions\ServerErrorException::class,
        504 => Exceptions\ServerErrorException::class,

        'default' => Exceptions\NylasException::class,
    ];

However all the exception were wrapped into a NylasException with error code 999. The error code is every useful to identify what error happen during api call. Thus we are going to run some particular process according to the error code.

class NylasException extends \Exception
{
    protected $code = 999;

    protected $message = 'some issue found when calling nylas.';
}

No need to require Account Id when connecting to Nylas

Hi there,

Thanks for the package and the overhaul. It is my understanding that we do not actually need the account ID to connect to nylas, and as such it should not be a "required" field to fire up a Nylas/Client.

Any chance you can remove this requirement?

Setting Options using $nylas->Options fails with 'class Nylas\Options\Abs not found!' exception

Current Behavior:

When attempting to set the access token as shown in the docs:

$nylas->Options->setAccessToken("pass the token you got");

the following exception is thrown:

[2022-03-07 22:39:17] local.DEBUG: Nylas\Exceptions\NylasException: class Nylas\Utilities\Abs not found! in /var/www/vendor/lanlin/nylas-php/src/Client.php:103
Stack trace:
#0 /var/www/vendor/lanlin/nylas-php/src/Client.php(79): Nylas\Client->callSubClass()
#1 /var/www/app/Services/NylasService.php(80): Nylas\Client->__get()
...

Expected Behavior:

The access token should be set.

Steps To Reproduce:

Create a client using these class methods:

/**
 * @var \Nylas\Client
 */
private Client $nylas;
  
/**
 * Nylas service constructor
 */
public function __construct()
{
  $this->nylas = self::getNylasClient();
}

/**
 * Create a new Nylas client
 *
 * @return \Nylas\Client
 */
public static function getNylasClient(): Client
  {
    $options = [
      'debug'            => config('app.debug'),
      'region'           => config('services.nylas.region'),
      'log_file'         => dirname(__FILE__) . '/nylas.log',
      'client_id'        => config('services.nylas.client_id'),
      'client_secret'    => config('services.nylas.client_secret'),
    ];

    return new Client($options);
  }

and call

$this->nylas->Options->setAccessToken("my_access_token");

Make Sending::getMessgeRules() public?

Would it be possible to make Sending::getMessageRules() public? I'd like to sanity check a message before calling sendDirectly().

Could getMessageRules() be static?

What does the error "All of the required rules must pass" means?

Hi Lanlin,

I'm receiving an error message from the SDK when trying to send an email. It has been working great for a few weeks now, so I'm not sure where this is suddenly coming from:

I'm getting:

All of the required rules must pass for `{ { "to": { ... }, "tracking": { "links": FALSE, "opens": TRUE, "thread_replies": TRUE }, "body":

... rest of the body

What does this mean?
I'm confused as to why it suddenly stopped working.

Thank you so much.

No Native Auth example in docs

I'm implementing this on a web app with it's own auth system that will be connected to nylas, and I think it would be helpful to include a native auth example (including the detectProvider function) in the docs.

am I missing a file?

local.ERROR: Return value of Nylas\Request\Sync::getStream() must implement interface Psr\Http\Message\ResponseInterface,

using php 7.4, nylas-php 4.2.2, composer 1.0.x - worked until we upgraded to php 7.4 on Ubuntu 20 LTS

Error: "Unable to parse response body into JSON: 10

Hi Lanlin,

I've hit a new issue, as described in the title. This is only happening on one account. If possible, would there be a way of simply ignoring if this error occurs on a single message, and move on to all the others? I have a feeling that for a single message the JSON is corrupt or something.

Thanks,

Rob

Support for Conference Sync - Beta

Hi, I wanted to create Google Meet meetings with the API as described in docs, but as I can see right now it's not supported by the library. Are you planning to update to support that? Or is it possible right now, but I didn't find the right thing?

how to launch the test ?

hello,
When I run vendor/bin/phpunit tests I have several failed. Perhaps I miss some parameters?

vendor/bin/phpunit tests/
PHPUnit 9.2.3 by Sebastian Bergmann and contributors.

EESESSSSSSESSSESSSSSESSSSESSSESSSSEESSSSESSSSSESSSSSSESSSESSSS    62 / 62 (100%)

Time: 00:10.284, Memory: 6.00 MB

There were 14 errors:

1) NylasTest\AccountTest::testGetAccount
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
2) NylasTest\CalendarTest::testGetOAuthAuthorize
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
3) NylasTest\ContactTest::testGetContactsList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
4) NylasTest\DeltaTest::testGetLatestCursor
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
5) NylasTest\DraftTest::testGetDraftList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
6) NylasTest\EventTest::testGetEventList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
7) NylasTest\FileTest::testGetFileList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
8) NylasTest\FolderTest::testGetFolderList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
9) NylasTest\HostedTest::testGetOAuthAuthorize
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
10) NylasTest\LabelTest::testGetLabelList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
11) NylasTest\ManageTest::testGetAccountList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
12) NylasTest\MessageTest::testGetMessagesList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
13) NylasTest\ThreadTest::testGetThreadList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
14) NylasTest\WebhookTest::testGetWebhookList
Nylas\Exceptions\NylasException: No valid API key or access_token provided. in /var/www/src/Request/Sync.php:45
Stack trace:
#0 /var/www/src/Accounts/Account.php(65): Nylas\Request\Sync->get()
#1 /var/www/src/Utilities/Options.php(108): Nylas\Accounts\Account->getAccount()
#2 /var/www/src/Utilities/Options.php(90): Nylas\Utilities\Options->setAccessToken()
#3 /var/www/src/Client.php(56): Nylas\Utilities\Options->__construct()
#4 /var/www/tests/Abs.php(43): Nylas\Client->__construct()
#5 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(583): NylasTest\Abs::setUpBeforeClass()
#6 /var/www/vendor/phpunit/phpunit/src/Framework/TestSuite.php(638): PHPUnit\Framework\TestSuite->run()
#7 /var/www/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(651): PHPUnit\Framework\TestSuite->run()
#8 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(108): PHPUnit\TextUI\TestRunner->run()
#9 /var/www/vendor/phpunit/phpunit/src/TextUI/Command.php(68): PHPUnit\TextUI\Command->run()
#10 /var/www/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#11 {main}
ERRORS!
Tests: 62, Assertions: 0, Errors: 14, Skipped: 48.

The requested item doesn't exist

Hello,
When I call the message API with messageID I got error "The requested item doesn't exist".
When I call same directly nylas API using Curl I got response successfully.
Thank You
Laukit

client initialization issue when no log file given

hello,
when we don't give any 'log_file' value, the default one is null

$this->setLogFile($options['log_file'] ?? null);

but setLogFile require a string

Argument 1 passed to Nylas\Utilities\Options::setLogFile() must be of the type string, null given, called in /var/www/stellar/vendor/lanlin/nylas-php/src/Utilities/Options.php on line 88

postOAuthRevoke return type

Hi there,

Thanks again for this great package. I'm getting the following error:

Return value of Nylas\Authentication\Hosted::postOAuthRevoke() must be of the type array, object returned

When calling:

$revoke = $client->Authentication()
                 ->Hosted()
                 ->postOAuthRevoke();

Looks like vendor/lanlin/nylas-php/src/Authentication/Hosted.php line 106, that function is actually returning an object instead of an array.

Sokil isocodes

Hi there, the latest update appears to have a dependency on sokil/php-isocodes which is causing all sorts of havoc with composer on my side. Do we need this dependency?

Stability and maintainability of this package in large scale production environment

Hey Lanlin,

It's awesome that you are maintaining a PHP SDK for Nylas, since they do not offer one. We are getting ready to refactor our Nylas integration and would love to build on top of this, just curious to get your thoughts on the overall stability.

Are you currently using this SDK in any production environments? Would you recommend utilizing the SDK in a large scale SAAS application?

Of course, if we do leverage the SDK, we would be happy to contribute to the project.

Let me know what you think.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.