### Install Lightfield Go Library Source: https://docs.lightfield.app/api/go Import the Lightfield Go library into your project. Use `go get -u` to pin a specific version. ```go import ( "github.com/Lightfld/lightfield-go" // imported as githubcomlightfldlightfieldgo ) ``` ```go go get -u 'github.com/Lightfld/lightfield-go@v0.9.0' ``` -------------------------------- ### Install Lightfield Go SDK Source: https://docs.lightfield.app/getting-started/go-quickstart Install the official Lightfield Go SDK using the go get command. Ensure you have Go 1.22+ installed. ```go go get -u github.com/Lightfld/lightfield-go ``` -------------------------------- ### Install Lightfield Go Package Source: https://docs.lightfield.app/api Install the Lightfield Go package using the go get command. Ensure you are using the specified version for compatibility. ```bash go get -u 'github.com/Lightfld/lightfield-go@v0.9.0' ``` -------------------------------- ### Install Lightfield SDK Source: https://docs.lightfield.app/getting-started/typescript-quickstart Install the Lightfield SDK from npm. ```bash npm install lightfield ``` -------------------------------- ### Create Meeting Example Source: https://docs.lightfield.app/api/go/resources/meeting/methods/create Demonstrates how to create a new meeting with essential fields like start date, end date, and title. Ensure you have your API key configured. The response includes the unique ID of the created meeting. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) meetingCreateResponse, err := client.Meeting.New(context.TODO(), githubcomlightfldlightfieldgo.MeetingNewParams{ Fields: githubcomlightfldlightfieldgo.MeetingNewParamsFields{ EndDate: "$endDate", StartDate: "$startDate", Title: "$title", }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", meetingCreateResponse.ID) } ``` -------------------------------- ### Account Creation Example Source: https://docs.lightfield.app/api/go Example of how to create a new account using the Lightfield Go client. It demonstrates setting required and optional fields, including string and array types. ```APIDOC ## Account.New ### Description Creates a new account with the specified fields. ### Method POST ### Endpoint /accounts ### Parameters #### Request Body - **Fields** (map[string]AccountNewParamsFieldUnion) - Required - A map of field names to their values for the new account. - **$name** (string) - Required - The name of the account. - **$industry** (string array) - Required - The industry associated with the account. ### Request Example ```json { "Fields": { "$name": { "string": "Acme Corp" }, "$industry": { "stringArray": ["opt_01j0x6q3m9v2p4t7k8n5r1s2u"] } } } ``` ### Response #### Success Response (200) - **ID** (string) - The unique identifier of the newly created account. #### Response Example ```json { "ID": "acc_12345" } ``` ``` -------------------------------- ### Install Lightfield CLI with Go Source: https://docs.lightfield.app/api/cli Install the CLI locally using Go version 1.22 or later. The binary will be placed in your Go bin directory. ```bash go install 'github.com/Lightfld/lightfield-cli/cmd/lightfield@latest' ``` -------------------------------- ### Install Lightfield Library Source: https://docs.lightfield.app/api/python Install the Lightfield library from PyPI using pip. ```bash pip install lightfield ``` -------------------------------- ### Install Lightfield with aiohttp support Source: https://docs.lightfield.app/api/python Install the Lightfield library with aiohttp support for improved concurrency. ```bash pip install lightfield[aiohttp] ``` -------------------------------- ### Install Lightfield CLI with Homebrew Source: https://docs.lightfield.app/api/cli Use this command to install the Lightfield CLI if you are using Homebrew. ```bash brew install Lightfld/lightfield/lightfield ``` -------------------------------- ### Account Creation Source: https://docs.lightfield.app/api/python Creates a new account with specified fields. This is a synchronous example. ```APIDOC ## POST /account ### Description Creates a new account. ### Method POST ### Endpoint /account ### Parameters #### Request Body - **fields** (object) - Required - A dictionary containing account fields. Example: `{"$name": "Acme Corp", "$industry": ["opt_01j0x6q3m9v2p4t7k8n5r1s2u"]}` ### Request Example ```python from lightfield import Lightfield client = Lightfield(api_key="My API Key") account_create_response = client.account.create( fields={ "$name": "Acme Corp", "$industry": ["opt_01j0x6q3m9v2p4t7k8n5r1s2u"], }, ) print(account_create_response.id) ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created account. #### Response Example ```json { "id": "acc_xxxxxxxxxxxxxxx" } ``` ``` -------------------------------- ### List Contacts Go Example Source: https://docs.lightfield.app/api/go/resources/contact/methods/list Demonstrates how to initialize the Lightfld Go client and list contacts. Ensure you have your API key set. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) contactListResponse, err := client.Contact.List(context.TODO(), githubcomlightfldlightfieldgo.ContactListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", contactListResponse.Data) } ``` -------------------------------- ### Create Opportunity Go Example Source: https://docs.lightfield.app/api/go/resources/opportunity/methods/create Demonstrates how to initialize the Lightfld client and create a new opportunity with specified fields and relationships. Ensure you replace 'My API Key' with your actual API key. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) opportunityCreateResponse, err := client.Opportunity.New(context.TODO(), githubcomlightfldlightfieldgo.OpportunityNewParams{ Fields: map[string]githubcomlightfldlightfieldgo.OpportunityNewParamsFieldUnion{ "foo": githubcomlightfldlightfieldgo.OpportunityNewParamsFieldUnion{ OfString: githubcomlightfldlightfieldgo.String("string"), }, }, Relationships: map[string]githubcomlightfldlightfieldgo.OpportunityNewParamsRelationshipUnion{ "foo": githubcomlightfldlightfieldgo.OpportunityNewParamsRelationshipUnion{ OfString: githubcomlightfldlightfieldgo.String("string"), }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", opportunityCreateResponse.ID) } ``` -------------------------------- ### Create Account with Go SDK Source: https://docs.lightfield.app/api/go/resources/account/methods/create Demonstrates how to initialize the Lightfield Go client and create a new account with specified fields. Ensure you have the Lightfield Go SDK installed and your API key is configured. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) accountCreateResponse, err := client.Account.New(context.TODO(), githubcomlightfldlightfieldgo.AccountNewParams{ Fields: map[string]githubcomlightfldlightfieldgo.AccountNewParamsFieldUnion{ "foo": githubcomlightfldlightfieldgo.AccountNewParamsFieldUnion{ OfString: githubcomlightfldlightfieldgo.String("string"), }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", accountCreateResponse.ID) } ``` -------------------------------- ### Retrieve Member Go Example Source: https://docs.lightfield.app/api/go/resources/member/methods/retrieve Demonstrates how to retrieve a member by ID using the Lightfield Go SDK. Ensure you have the SDK installed and your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) memberRetrieveResponse, err := client.Member.Get(context.TODO(), "id") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", memberRetrieveResponse.ID) } ``` -------------------------------- ### List Opportunities in Go Source: https://docs.lightfield.app/api/go/resources/opportunity/methods/list Demonstrates how to initialize the Lightfld Go client and call the Opportunity List method. Ensure you have your API key set. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) opportunityListResponse, err := client.Opportunity.List(context.TODO(), githubcomlightfldlightfieldgo.OpportunityListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", opportunityListResponse.Data) } ``` -------------------------------- ### Create Meeting in Python Source: https://docs.lightfield.app/api/python/resources/meeting/methods/create Use this snippet to create a new meeting by providing start date, end date, and title. Requires the Lightfield library to be installed. ```python from lightfield import Lightfield client = Lightfield( api_key="My API Key", ) meeting_create_response = client.meeting.create( fields={ "end_date": "$endDate", "start_date": "$startDate", "title": "$title", }, ) print(meeting_create_response.id) ``` -------------------------------- ### Run Go Quickstart Script Source: https://docs.lightfield.app/getting-started/go-quickstart Execute the Go script from your terminal to make the API request. This command assumes your file is named main.go. ```bash go run main.go ``` -------------------------------- ### List Accounts in Go Source: https://docs.lightfield.app/api/go/resources/account/methods/list Demonstrates how to initialize the Lightfld Go client and call the Account.List method to retrieve a list of accounts. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) accountListResponse, err := client.Account.List(context.TODO(), githubcomlightfldlightfieldgo.AccountListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", accountListResponse.Data) } ``` -------------------------------- ### Lightfield Authentication Error Example Source: https://docs.lightfield.app/getting-started/python-quickstart Example of an authentication error when the API key is invalid. ```python lightfield.AuthenticationError: Error code: 401 - {'error': {'type': 'unauthorized', 'message': 'Invalid API key.'}} ``` -------------------------------- ### Send an email using Lightfld Go Source: https://docs.lightfield.app/api/go/resources/email/methods/send Demonstrates how to send a basic email using the `client.Email.Send` method. Ensure you have initialized the client with your API key and provide the necessary `EmailSendParams` including sender, message content, subject, and recipients. This example uses `context.TODO()` for simplicity; in production, use a proper context. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) emailSendResponse, err := client.Email.Send(context.TODO(), githubcomlightfldlightfieldgo.EmailSendParams{ From: "sales@acme.com", MessageBody: githubcomlightfldlightfieldgo.EmailSendParamsMessageBody{ Content: "
Hi there,
Following up on our chat earlier this week.
", }, Subject: "Following up on our chat", To: []string{"lead@example.com"}, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", emailSendResponse.SentAt) } ``` -------------------------------- ### Create a Note with Go Source: https://docs.lightfield.app/api/go/resources/note/methods/create Demonstrates how to initialize the Lightfld client and create a new note with a title. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) noteCreateResponse, err := client.Note.New(context.TODO(), githubcomlightfldlightfieldgo.NoteNewParams{ Fields: githubcomlightfldlightfieldgo.NoteNewParamsFields{ Title: "$title", }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", noteCreateResponse.ID) } ``` -------------------------------- ### List Notes with Go SDK Source: https://docs.lightfield.app/api/go/resources/note/methods/list Demonstrates how to initialize the Lightfld Go client and call the Note.List method to retrieve a list of notes. Ensure you have your API key configured. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) noteListResponse, err := client.Note.List(context.TODO(), githubcomlightfldlightfieldgo.NoteListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", noteListResponse.Data) } ``` -------------------------------- ### List Tasks in Go Source: https://docs.lightfield.app/api/go/resources/task/methods/list Demonstrates how to initialize the Lightfld client and list tasks using the Task.List method. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) taskListResponse, err := client.Task.List(context.TODO(), githubcomlightfldlightfieldgo.TaskListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", taskListResponse.Data) } ``` -------------------------------- ### Successful Account List Response Example Source: https://docs.lightfield.app/getting-started/python-quickstart Example of a successful response when listing accounts with limit=1. ```python AccountListResponse( data=[ Data( id="id", created_at="created_at", fields={ "foo": DataFields(value="string", value_type="value_type"), }, http_link="http_link", relationships={ "foo": DataRelationships( cardinality="cardinality", object_type="object_type", values=["string"], ), }, ) ], object="list", total_count=1, ) ``` -------------------------------- ### List Meetings with Go SDK Source: https://docs.lightfield.app/api/go/resources/meeting/methods/list Demonstrates how to initialize the Lightfld client and call the List method to retrieve a list of meetings. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) meetingListResponse, err := client.Meeting.List(context.TODO(), githubcomlightfldlightfieldgo.MeetingListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", meetingListResponse.Data) } ``` -------------------------------- ### Verify Lightfield CLI Installation Source: https://docs.lightfield.app/getting-started/cli-quickstart Check that the Lightfield CLI has been installed correctly by running the version command. ```bash lightfield --version ``` -------------------------------- ### Social Handle URL Examples Source: https://docs.lightfield.app/using-the-api/fields-and-relationships Examples of valid social media profile URLs for TWITTER, LINKEDIN, and INSTAGRAM platforms. ```string "https://x.com/lightfield" ``` ```string "https://www.linkedin.com/in/jane-doe" ``` ```string "https://www.instagram.com/lightfield" ``` -------------------------------- ### Lightfield Permission Denied Error Example Source: https://docs.lightfield.app/getting-started/python-quickstart Example of a permission denied error when the API key lacks the required scope. ```python lightfield.PermissionDeniedError: Error code: 403 - {'error': {'type': 'forbidden', 'message': "Token does not have the 'accounts:read' scope."}} ``` -------------------------------- ### File Upload Completion Response Example Source: https://docs.lightfield.app/api/cli/resources/file/methods/complete This is an example of a successful response when completing a file upload. It includes details about the file and its upload status. ```json { "id": "id", "completedAt": "completedAt", "createdAt": "createdAt", "expiresAt": "expiresAt", "filename": "filename", "mimeType": "mimeType", "sizeBytes": -9007199254740991, "status": "PENDING" } ``` -------------------------------- ### List Files in Go Source: https://docs.lightfield.app/api/go/resources/file/methods/list Demonstrates how to list files using the Lightfld Go client. Ensure you have the correct API key and import necessary packages. The `FileListParams` can be used to specify pagination parameters. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) fileListResponse, err := client.File.List(context.TODO(), githubcomlightfldlightfieldgo.FileListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fileListResponse.Data) } ``` -------------------------------- ### List Opportunities in Go Source: https://docs.lightfield.app/api/go/resources/list/methods/listOpportunities This Go snippet demonstrates how to initialize the Lightfld client and call the ListOpportunities method to retrieve a list of opportunities. Ensure you have your API key and the correct list ID. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) listListOpportunitiesResponse, err := client.List.ListOpportunities( context.TODO(), "listId", githubcomlightfldlightfieldgo.ListListOpportunitiesParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", listListOpportunitiesResponse.Data) } ``` -------------------------------- ### Create a Task Source: https://docs.lightfield.app/api/go/resources/task/methods/create Demonstrates how to create a new task with specified fields and relationships using the Lightfld Go client. Ensure you have the Lightfld Go SDK imported and a valid API key. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) taskCreateResponse, err := client.Task.New(context.TODO(), githubcomlightfldlightfieldgo.TaskNewParams{ Fields: githubcomlightfldlightfieldgo.TaskNewParamsFields{ Status: "$status", Title: "$title", }, Relationships: map[string]githubcomlightfldlightfieldgo.TaskNewParamsRelationshipUnion{ "foo": githubcomlightfldlightfieldgo.TaskNewParamsRelationshipUnion{ OfString: githubcomlightfldlightfieldgo.String("string"), }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", taskCreateResponse.ID) } ``` -------------------------------- ### Workflow Run Status Response Example Source: https://docs.lightfield.app/api/cli/resources/workflowRun/methods/status Example of a successful response when querying the status of a workflow run. The response includes the current status of the run. ```json { "status": "status" } ``` -------------------------------- ### Contact Retrieve Response Example Source: https://docs.lightfield.app/api/cli/resources/contact/methods/retrieve This is an example of a successful response when retrieving a contact. It includes details like ID, creation timestamp, fields, and relationships. ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ``` -------------------------------- ### List Opportunities via CLI Source: https://docs.lightfield.app/api/cli/resources/opportunity/methods/list Use the Lightfield CLI to list opportunities. Ensure you have your API key configured. ```bash lightfield opportunity list \ --api-key 'My API Key' ``` -------------------------------- ### Example successful JSON response for listing accounts Source: https://docs.lightfield.app/getting-started/http-quickstart This is an example of a successful JSON response when listing accounts with a limit of 1. It includes account details and metadata. ```json { "data": [ { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "valueType" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } } } ], "object": "object", "totalCount": 1 } ``` -------------------------------- ### Initialize Lightfield Client and List Accounts Source: https://docs.lightfield.app/getting-started/python-quickstart Initialize the Lightfield client with your API key and list one account to verify. ```python from lightfield import Lightfield client = Lightfield( api_key="My API Key", ) # list one account accounts = client.account.list(limit=1) print(accounts) ``` -------------------------------- ### File List Response Example Source: https://docs.lightfield.app/api/go/resources/file/methods/list This is an example of a successful response when listing files, showing the structure of the returned data, including file details and total count. ```json { "data": [ { "id": "id", "completedAt": "completedAt", "createdAt": "createdAt", "expiresAt": "expiresAt", "filename": "filename", "mimeType": "mimeType", "sizeBytes": -9007199254740991, "status": "PENDING" } ], "object": "object", "totalCount": 0 } ``` -------------------------------- ### 200 OK Response Example Source: https://docs.lightfield.app/api/cli/resources/member/methods/retrieve This is an example of a successful response when retrieving member details. It includes the member's ID, creation timestamp, fields, and other relevant information. ```json { "id": "id", "createdAt": "createdAt", "fields": { "$email": { "value": "value", "valueType": "EMAIL" }, "$name": { "value": { "firstName": "firstName", "lastName": "lastName" }, "valueType": "FULL_NAME" }, "$profileImage": { "value": "value", "valueType": "URL" }, "$role": { "value": "value", "valueType": "TEXT" } }, "httpLink": "httpLink", "relationships": {}, "updatedAt": "updatedAt" } ``` -------------------------------- ### List Notes with Python SDK Source: https://docs.lightfield.app/api/python/resources/note/methods/list Demonstrates how to initialize the Lightfield client and retrieve a paginated list of notes. Ensure you have your API key. ```python from lightfield import Lightfield client = Lightfield( api_key="My API Key", ) note_list_response = client.note.list() print(note_list_response.data) ``` -------------------------------- ### Retrieve Email API Response Example Source: https://docs.lightfield.app/api/cli/resources/email/methods/retrieve Example of a successful response when retrieving an email. The response includes email details, access level, and associated relationships. ```json { "id": "eml_cm0abc456def789", "accessLevel": "FULL", "createdAt": "2026-05-01T09:00:00.000Z", "fields": { "$subject": { "value": "Following up on our chat", "valueType": "TEXT" }, "$sentAt": { "value": "2026-05-01T08:30:00.000Z", "valueType": "DATETIME" }, "$from": { "value": [ "sales@acme.com" ], "valueType": "EMAIL" }, "$to": { "value": [ "lead@example.com" ], "valueType": "EMAIL" }, "$cc": { "value": [ "string" ], "valueType": "EMAIL" }, "$bcc": { "value": [ "string" ], "valueType": "EMAIL" }, "$privacySetting": { "value": "string", "valueType": "TEXT" }, "$body": { "value": "Hi there,
Following up on our chat earlier this week.
", "valueType": "HTML" } }, "httpLink": null, "objectType": "email", "relationships": { "$account": { "cardinality": "has_many", "objectType": "account", "values": [ "acc_cm4stu901uvw234" ] }, "$contact": { "cardinality": "has_many", "objectType": "contact", "values": [ "con_cm2ghi789jkl012" ] } }, "updatedAt": "2026-05-01T10:00:00.000Z", "externalId": "externalId" } ``` -------------------------------- ### Create List Response Example Source: https://docs.lightfield.app/api/cli/resources/list/methods/create Example of a successful response when creating a list. This includes the list's ID, creation timestamp, fields, and a direct link. ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink" } ``` -------------------------------- ### Get Opportunity Field Definitions in Go Source: https://docs.lightfield.app/api/go/resources/opportunity/methods/definitions Demonstrates how to initialize the Lightfld Go client and call the Opportunity Definitions API. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) opportunityDefinitionsResponse, err := client.Opportunity.Definitions(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", opportunityDefinitionsResponse.FieldDefinitions) } ``` -------------------------------- ### File Download URL Response Example Source: https://docs.lightfield.app/api/cli/resources/file/methods/url This is an example of the JSON response when successfully retrieving a file's download URL. It includes the expiration timestamp and the URL itself. ```json { "expiresAt": "expiresAt", "url": "url" } ``` -------------------------------- ### List Accounts API Response Example Source: https://docs.lightfield.app/api/cli/resources/account/methods/list This is an example of a successful (200 OK) response when listing accounts. It includes account data, object type, and total count. ```json { "data": [ { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ], "object": "object", "totalCount": 0 } ``` -------------------------------- ### Make First Lightfield API Request in Go Source: https://docs.lightfield.app/getting-started/go-quickstart Create a Lightfield client and list one account to verify your API key and scope. Replace 'My API Key' with your actual API key. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) accounts, err := client.Account.List(context.TODO(), githubcomlightfldlightfieldgo.AccountListParams{ Limit: githubcomlightfldlightfieldgo.Int(1), }) if err != nil { panic(err) } fmt.Printf("%+v\n", accounts) } ``` -------------------------------- ### Get a custom object record Source: https://docs.lightfield.app/api/python/resources/object/methods/retrieve Retrieves a single record by ID for the specified custom object type using the GET /v1/objects/{entitySlug}/values/{id} endpoint. ```APIDOC ## GET /v1/objects/{entitySlug}/values/{id} ### Description Retrieves a single record by ID for the specified custom object type. ### Method GET ### Endpoint /v1/objects/{entitySlug}/values/{id} ### Parameters #### Path Parameters - **entity_slug** (str) - Required - The slug of the custom object type. - **id** (str) - Required - The ID of the record to retrieve. ### Response #### Success Response (200) - **id** (str) - Unique identifier for the entity. - **created_at** (str) - ISO 8601 timestamp of when the entity was created. - **fields** (Dict[str, Fields]) - Map of field names to their typed values. System fields are prefixed with `$`. Custom attributes use their bare slug. - **value** (Optional[FieldsValue]) - The field value, or null if unset. Can be str, float, bool, or List[str]. - **http_link** (Optional[str]) - URL to view the entity in the Lightfield web app, or null. - **relationships** (Dict[str, Relationships]) - Map of relationship names to their associated entities. System relationships are prefixed with `$`. Each relationship contains `cardinality`, `object_type`, and `values` (List[str]). - **updated_at** (Optional[str]) - ISO 8601 timestamp of when the entity was last updated, or null. - **external_id** (Optional[str]) - External identifier for the entity, or null if unset. ### Response Example ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ``` ``` -------------------------------- ### Retrieve a File using Go Client Source: https://docs.lightfield.app/api/go/resources/file/methods/retrieve Demonstrates how to initialize the Lightfld Go client and retrieve a file by its ID. Ensure you have the correct API key and the file ID. The scope `files:read` is required. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) fileRetrieveResponse, err := client.File.Get(context.TODO(), "id") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fileRetrieveResponse.ID) } ``` -------------------------------- ### List Lists with Go SDK Source: https://docs.lightfield.app/api/go/resources/list/methods/list Demonstrates how to initialize the Lightfield Go client and call the List.List method to retrieve a paginated list of lists. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) listListResponse, err := client.List.List(context.TODO(), githubcomlightfldlightfieldgo.ListListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", listListResponse.Data) } ``` -------------------------------- ### List Tasks with Default Parameters Source: https://docs.lightfield.app/api/python/resources/task/methods/list Demonstrates how to list tasks using the default pagination parameters. Requires initializing the Lightfield client with an API key. ```python from lightfield import Lightfield client = Lightfield( api_key="My API Key", ) task_list_response = client.task.list() print(task_list_response.data) ``` -------------------------------- ### List Meetings API Response (200 Example) Source: https://docs.lightfield.app/api/cli/resources/meeting/methods/list Example JSON response for a successful request to list meetings. Includes meeting data, object type, and total count. ```json { "data": [ { "id": "id", "accessLevel": "FULL", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "objectType": "meeting", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ], "object": "object", "totalCount": 0 } ``` -------------------------------- ### Get File Download URL Source: https://docs.lightfield.app/api/typescript/resources/file/methods/url Use this method to get a temporary download URL for a specific file. Ensure the file is in 'COMPLETED' status. The response includes the expiration time and the URL itself. ```typescript import Lightfield from 'lightfield'; const client = new Lightfield({ apiKey: 'My API Key', }); const fileURLResponse = await client.file.url('id'); console.log(fileURLResponse.expiresAt); ``` -------------------------------- ### Create Account with Fields and Relationships Source: https://docs.lightfield.app/api/typescript/resources/account/methods/create Shows how to create an account with additional fields like `$website` and establish relationships, for example, with an owner. ```typescript import { AccountCreateParams } from "@lightfield/api"; const accountCreateParams: AccountCreateParams = { fields: { "$name": "Acme Corporation", "$website": "https://acme.com", "industry": "Technology" }, relationships: { "$owner": "user-id-123" } }; client.account.create(accountCreateParams) ``` -------------------------------- ### Get Contact Field Definitions Source: https://docs.lightfield.app/api/go/resources/contact Retrieves the definitions for contact fields. ```APIDOC ## Get Contact Field Definitions ### Description Retrieves the definitions for contact fields. ### Method GET ### Endpoint /v1/contacts/definitions ### Response #### Success Response (200) - **definitions** (object) - The field definitions for contacts. ``` -------------------------------- ### Get task field definitions Source: https://docs.lightfield.app/api/cli/resources/task Retrieves the field definitions for tasks. ```APIDOC ## Get task field definitions ### Description Retrieves the field definitions for tasks. ### Method GET ### Endpoint /v1/tasks/definitions ``` -------------------------------- ### Configure HTTP Client with Proxies Source: https://docs.lightfield.app/api/python Initialize the Lightfield client with a custom `httpx.Client`, specifying proxy settings and a local transport address. ```python import httpx from lightfield import Lightfield, DefaultHttpxClient client = Lightfield( # Or use the `LIGHTFIELD_BASE_URL` env var base_url="http://my.test.server.example.com:8083", http_client=DefaultHttpxClient(proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0")), ) ``` -------------------------------- ### Get opportunity field definitions Source: https://docs.lightfield.app/api/cli/resources/opportunity Retrieves the definitions for opportunity fields. ```APIDOC ## GET /v1/opportunities/definitions ### Description Retrieves the definitions for opportunity fields. ### Method GET ### Endpoint /v1/opportunities/definitions ```