Skip to content

structure-ac/structure-go

Repository files navigation

Go SDK

Discover rich information on people and companies

SDK Installation

go get github.com/structure-ac/structure-go

Authentication

You'll need to authenticate your requests to access any of the endpoints in the Structure API. In this guide, we'll look at how authentication works. Structure offers authentication for your API requests with a token.

OAuth2 with bearer token

Authentication with the Structure API is using OAuth2. When establishing a connection using OAuth2, you will need your access token — you will find it in the Structure dashboard under API settings.

SDK Example Usage

package main

import(
	"context"
	"log"
	"Structure"
	"Structure/pkg/models/operations"
)

func main() {
    s := sdk.New(
        sdk.WithSecurity(shared.Security{
            BearerAuth: "",
        }),
    )

    ctx := context.Background()
    res, err := s.Companies.Enrich(ctx, operations.EnrichCompanyRequest{
        ID: "89bd9d8d-69a6-474e-8f46-7cc8796ed151",
    })
    if err != nil {
        log.Fatal(err)
    }

    if res.Body != nil {
        // handle response
    }
}

Available Resources and Operations

  • Login - Login user
  • Me - Show current user

SDK Generated by Speakeasy