Golang - sgml/signature GitHub Wiki

Examples

Sample Code

package main

import (
    "fmt"
    "log"

    "github.com/belong-inc/go-hubspot"
)

func main() {
    // Initialize the HubSpot client with your private app access token
    client, err := hubspot.NewClient(hubspot.SetPrivateAppToken("YOUR_ACCESS_TOKEN"))
    if err != nil {
        log.Fatalf("Error creating HubSpot client: %v", err)
    }

    // Get a contact by ID
    contactID := "yourContactID"
    contact, err := client.CRM().Contacts().GetByID(contactID)
    if err != nil {
        log.Fatalf("Error getting contact: %v", err)
    }

    // Print the contact details
    fmt.Printf("Contact ID: %s\n", contact.ID)
    fmt.Printf("Contact Name: %s\n", contact.Properties["firstname"])
}

Template Strings

WebAssembly

GRPC

References

⚠️ **GitHub.com Fallback** ⚠️