Skip to content

[62344] Added Nylas-API-Version header support#157

Merged
mrashed-dev merged 6 commits into
mainfrom
mostafarashed/ch62344/better-nylas-api-version-header-support
Jun 15, 2021
Merged

[62344] Added Nylas-API-Version header support#157
mrashed-dev merged 6 commits into
mainfrom
mostafarashed/ch62344/better-nylas-api-version-header-support

Conversation

@mrashed-dev
Copy link
Copy Markdown
Contributor

@mrashed-dev mrashed-dev commented Jun 14, 2021

Description

Now we specify the Nylas-API-Version header and send it with every request made to the Nylas API. With this change:

  • There is a new SUPPORTED_API_VERSION value that acts as the default API version
  • Users are able to override this value and use an API version of their choice to specify a api_version when initializing a new APIClient

Usage

The usage does not change if you are fine with using the latest supported API. However, if you want to use a different version you may create a new instance of APIClient like so:

nylas = APIClient(
    client_id=CLIENT_ID,
    client_secret=CLIENT_SECRET,
    access_token=ACCESS_TOKEN,
    api_version='2.1'
)

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Now we specify the `Nylas-API-Version` header and send it with every request made to the Nylas API. With this change:

* There is a new `SUPPORTED_API_VERSION` value that acts as the default API version
* Users are able to override this value and use an API version of their choice to specify a `api_version` when initializing a new `APIClient`
@shortcut-integration
Copy link
Copy Markdown

This pull request has been linked to Clubhouse Story #62344: Better Nylas-API-Version header support.

@mrashed-dev mrashed-dev marked this pull request as draft June 14, 2021 21:19
@mrashed-dev mrashed-dev changed the title Added Nylas-API-Version support Added Nylas-API-Version header support Jun 14, 2021
@mrashed-dev mrashed-dev changed the title Added Nylas-API-Version header support [62344] Added Nylas-API-Version header support Jun 14, 2021
@mrashed-dev mrashed-dev marked this pull request as ready for review June 14, 2021 21:29
consistency
Copy link
Copy Markdown

@yusra-ahmed-zz yusra-ahmed-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mrashed-dev mrashed-dev merged commit 2f4cdc9 into main Jun 15, 2021
@mrashed-dev mrashed-dev deleted the mostafarashed/ch62344/better-nylas-api-version-header-support branch June 15, 2021 19:08
mrashed-dev added a commit that referenced this pull request Jul 21, 2021
New `nylas` v5.0.0 release bringing in the following additions:
* Add support for the Nylas Neural API (#163)
* Add `metadata` support (#152)
* Add new Room Resource fields  (#156)
* Add `Nylas-API-Version` header support (#157, #151)

as well as the following changes:
* Transitioned from `app_id` and `app_secret` naming to `client_id` and `client_secret` (#159, #86)
* Fix adding a tracking object to an existing `draft` (#153)
* Fix issue when converting offset-aware `datetime` objects to `timestamp` (#154, #143)
* Fix `limit` value in filter not being used when making `.all()` call (#155)
* Fix `from_` field set by attribute on draft ignored (#162, #160)
* Remove `bumpversion` from a required dependency to an extra dependency (#158, #144)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to specify Nylas-API-Version (2.1 required for event.ics_uid)

2 participants