lanlin / nylas-php Goto Github PK
View Code? Open in Web Editor NEWNylas PHP SDK (API 2.7 support).
Home Page: https://packagist.org/packages/lanlin/nylas-php
License: MIT License
Nylas PHP SDK (API 2.7 support).
Home Page: https://packagist.org/packages/lanlin/nylas-php
License: MIT License
This feature is currently in beta but available upon request. Currently the validator breaks the ability to use this functionality. Could collective be added to the scheduling method validator in addition to the round robin methods for the Scheduler validator.
Hi. Are there any plans to support the Irish and Canadian servers, please? As per https://docs.nylas.com/docs/data-residency
Ireland: https://ireland.api.nylas.com/
Canada: https://canada.api.nylas.com/
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.
It would be very useful to support the Nylas Scheduler API (https://developer.nylas.com/docs/api/scheduler/#overview), which allows imbedding custom scheduling pages/flows into an app.
any examples?
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:
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.
Hi,
We need to use the Free/Busy API from Nylas. I have created a Pull Request. You can check the documentation here: https://developer.nylas.com/docs/connectivity/calendar/calendar-availability/#free/busy. Could you take a look, please?
PR: #39
Regards,
Oliver
Error: An error was encountered during the on_headers event
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,
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?
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
$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
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.';
}
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?
H
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()
...
The access token should be set.
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");
Would it be possible to make Sending::getMessageRules()
public? I'd like to sanity check a message before calling sendDirectly()
.
Could getMessageRules()
be static?
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.
Hello,
instead of a file, I think that using https://github.com/php-fig/log could be better. It allow people to inject it inside they framework logger instead of creating a file....
thanks
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.
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
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
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?
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.
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
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
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.
Hello @lanlin,
For public function addDraft(array $params) has a baseRules which doesn't have reply_to_message_id, when I call it will cause crash.
It would be nice if add this.
Thank you.
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?
Hello,
perhaps it could be good to add travis or a similar tools to have the test running properly ?
see https://docs.travis-ci.com/user/languages/php/ (or I can do a PR once #8 is answered ;))
hello,
in https://docs.nylas.com/reference#oauthauthorize we can see that login_int & state are not required, but this lib make it as a requirement.
if you look at the official website, sending draft support 'tracking' param.
https://docs.nylas.com/reference#sending-drafts
Can we support it?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.