Provides access to the Nylas Platform v2 REST API.
This library does not currently cover all endpoints and will be implemented as and when they are needed by our internal projects. Check the GoDoc or Status for current implementation status.
This is not an official SDK for the Nylas Platform, for the official SDKs visit Nylas SDKs.
go get github.com/teamwork/nylas-go
package main
import (
"context"
"log"
"net/http"
"time"
nylas "github.com/teamwork/nylas-go"
)
const (
clientID = "..."
clientSecret = "..."
accessToken = "..."
)
func main() {
client := nylas.NewClient(clientID, clientSecret,
nylas.WithHTTPClient(&http.Client{
Timeout: 3 * time.Second,
}),
nylas.WithAccessToken(accessToken), // not required for account management endpoints
)
ctx := context.Background()
deltaResp, err := client.Deltas(ctx, cursor, &nylas.DeltasOptions{
View: nylas.ViewExpanded,
IncludeTypes: []string{"thread"},
})
if err != nil {
log.Fatalf("get thread deltas: %v", err)
}
for _, d := range deltaResp.Deltas {
log.Printf("%+v", d)
}
}
See the example directory.
We would like to make this library feature complete with the offical SDK projects and contributions are welcome.
Following the existing code style and conventions and submit a PR.
The following features are implemented in the client:
- GET /oauth/authorize
- POST /oauth/token
- POST /oauth/revoke
- POST /connect/authorize
- POST /connect/token
- GET /account
- GET /a/{client_id}/accounts
- GET /a/{client_id}/accounts/{id}
- DEL /a/{client_id}/accounts/{id}
- POST /a/{client_id}/accounts/{id}/downgrade
- POST /a/{client_id}/accounts/{id}/upgrade
- POST /a/{client_id}/accounts/{id}/revoke-all
- GET /a/{client_id}/ip_addresses
- POST /a/{client_id}/accounts/{id}/token-info
- GET /a/{client_id}
- POST /a/{client_id}
- GET /threads
- GET /threads/{id}
- PUT /threads/{id}
- GET /messages
- GET /messages/{id}
- PUT /messages/{id}
- GET /messages/{id} (raw message content)
- GET /folders
- GET /folders/{id}
- POST /folders
- PUT /folders/{id}
- DEL /folders/{id}
- GET /labels
- GET /labels/{id}
- POST /labels
- PUT /labels/{id}
- DEL /labels/{id}
- GET /drafts
- GET /drafts/{id}
- POST /drafts
- PUT /drafts/{id}
- DEL /drafts/{id}
- POST /send#drafts
- POST /send#directly
- POST /send#raw
- GET /files
- GET /files/{id}
- GET /files/{id}/download
- POST /files
- DEL /files/{id}
- GET /calendars
- GET /calendars/{id}
- POST /calendars/free-busy
- GET /events
- GET /events/{id}
- POST /events
- PUT /events/{id}
- DEL /events/{id}
- POST /send-rsvp
- GET /resources
- GET /contacts
- GET /contacts/{id}
- POST /contacts
- PUT /contacts/{id}
- DEL /contacts/{id}
- GET /contacts/{id}/picture
- GET /contacts/groups
- GET /threads/search
- GET /messages/search
- Listener client
- GET /webhooks
- POST /webhooks
- GET /webhooks/{id}
- PUT /webhooks/{id}
- DEL /webhooks/{id}
- POST /delta/latest_cursor
- GET /delta
- GET /delta/longpoll
- GET /delta/streaming