# Packages
# README
Go SDK for Synk API
The Snyk API v1 has the ability to test a package for issues as they are defined by Snyk, and to provide Snyk security automation according to your own workflows, unconstrained by security processes in Snyk products. Customers and partners can perform functions including
SDK Installation
go get github.com/speakeasy-sdks/snyk-go
Authentication
To use the Snyk API, you must first get your API token from Snyk. Go to the General Account Settings in your Snyk account. In the KEY
field, click to show and then select and copy your API token. Refer to the screenshot that follows.
To use the Snyk API, supply the token in an Authorization header, preceded by Token
: Authorization
: Token API_KEY
For more information about authentication, refer to the overview in the API reference docs. For additional information see Revoking and regenerating Snyk API tokens.
SDK Example Usage
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/snyk-go"
"github.com/speakeasy-sdks/snyk-go/pkg/models/operations"
)
func main() {
s := snyk.New()
ctx := context.Background()
res, err := s.DeleteConnection(ctx, operations.DeleteConnectionRequestBody{
AccessToken: snyk.String("corrupti"),
}, operations.DeleteConnectionSecurity{
VesselAPIToken: "YOUR_API_KEY_HERE",
})
if err != nil {
log.Fatal(err)
}
if res.DeleteConnection200ApplicationJSONString != nil {
// handle response
}
}
Available Resources and Operations
Snyk SDK
- DeleteConnection - Delete connection
- DeleteWebhook - Remove Webhook
- GetAccount - Get Account
- GetAccountDetails - Get Account Details
- GetConnection - Get Connection
- GetConnections - Get All Connections
- GetContact - Get Contact
- GetContactDetails - Get Contact Details
- GetContacts - Get All Contacts
- GetCrmAccounts - Get All Accounts
- GetCrmDeals - Get All Deals
- GetCrmUsers - Get All Users
- GetDeal - Get Deal
- GetDealDetails - Get Deal Details
- GetEvent - Get Event
- GetEventAttendee - Get Event Attendee
- GetEventAttendeeDetails - Get Event Attendee Details
- GetEventAttendees - Get All Event Attendees
- GetEventDetails - Get Event Details
- GetEvents - Get All Events
- GetIntegrations - Get CRM Integrations
- GetLead - Get Lead
- GetLeadDetails - Get Lead Details
- GetLeads - Get all Leads
- GetNote - Get Note
- GetNoteDetails - Get Note Details
- GetNotes - Get All Notes
- GetTask - Get Task
- GetTaskDetails - Get Task Details
- GetTasks - Get All Tasks
- GetUser - Get User
- GetUserDetails - Get User Details
- GetWebhook - Get Webhook
- PatchEventAttendee - Update Event Attendee
- PostAccount - Create Account
- PostContact - Create Contact
- PostCrmTask - Create Task
- PostDeal - Create Deal
- PostEvent - Create Event
- PostEventAttendee - Create Event Attendee
- PostLead - Create Lead
- PostLinkExchange - Exchange public token for access token
- PostLinkToken - Create link token
- PostNote - Create Note
- PostWebhook - Create Webhook
- PutAccount - Update Account
- PutContactJSON - Update Contact
- PutContactRaw - Update Contact
- PutDeal - Update Deal
- PutEvent - Update Event
- PutLead - Update Lead
- PutNote - Update Note
- PutTask - Update Task