Skip to main content
Glama
read.md2.34 kB
### Search messages `/messages/search` → [`GET /v3/grants/<NYLAS_GRANT_ID>/messages` request](https://developer.nylas.com/docs/api/v3/ecc/#get-/v3/grants/-grant_id-/messages) ```Node import 'dotenv/config' import Nylas from 'nylas' const NylasConfig = { apiKey: process.env.NYLAS_API_KEY, apiUri: process.env.NYLAS_API_URI, } const nylas = new Nylas(NylasConfig) async function searchInbox() { try { const result = await nylas.messages.list({ identifier: process.env.NYLAS_GRANT_ID, queryParams: { search_query_native: 'nylas', limit: 5 } }) console.log('search results:', result) } catch (error) { console.error('Error to complete search:', error) } } searchInbox() ``` ```Java ``` ```Python from dotenv import load_dotenv load_dotenv() import os import sys from nylas import Client nylas = Client( os.environ.get('NYLAS_API_KEY'), os.environ.get('NYLAS_API_URI') ) grant_id = os.environ.get("NYLAS_GRANT_ID") messages = nylas.messages.list( grant_id, query_params={ "limit": 5, "search_query_native": 'nylas' } ) print(messages) ``` ```Ruby ``` ```API ``` ### Search threads `/threads/search` → [`GET /v3/grants/<NYLAS_GRANT_ID>/threads` request](https://developer.nylas.com/docs/api/v3/ecc/#get-/v3/grants/-grant_id-/threads) ```Node import 'dotenv/config' import Nylas from 'nylas' const NylasConfig = { apiKey: process.env.NYLAS_API_KEY, apiUri: process.env.NYLAS_API_URI, } const nylas = new Nylas(NylasConfig) async function searchInbox() { try { const result = await nylas.threads.list({ identifier: process.env.NYLAS_GRANT_ID, queryParams: { search_query_native: 'nylas', limit: 5 } }) console.log('search results:', result) } catch (error) { console.error('Error to complete search:', error) } } searchInbox() ``` ```Java ``` ```Python from dotenv import load_dotenv load_dotenv() import os import sys from nylas import Client nylas = Client( os.environ.get('NYLAS_API_KEY'), os.environ.get('NYLAS_API_URI') ) grant_id = os.environ.get("NYLAS_GRANT_ID") messages = nylas.threads.list( grant_id, query_params={ "limit": 5, "search_query_native": 'nylas' } ) print(messages) ``` ```Ruby ``` ```API ```

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nylas-samples/nylas-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server