Skip to content

Latest commit

 

History

History
382 lines (245 loc) · 10.8 KB

CoreApi.md

File metadata and controls

382 lines (245 loc) · 10.8 KB

\CoreApi

All URIs are relative to https://api.hubapi.com

Method HTTP request Description
Archive Delete /crm/v3/properties/{objectType}/{propertyName} Archive a property
Create Post /crm/v3/properties/{objectType} Create a property
GetAll Get /crm/v3/properties/{objectType} Read all properties
GetByName Get /crm/v3/properties/{objectType}/{propertyName} Read a property
Update Patch /crm/v3/properties/{objectType}/{propertyName} Update a property

Archive

Archive(ctx, objectType, propertyName).Execute()

Archive a property

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    objectType := "objectType_example" // string | 
    propertyName := "propertyName_example" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CoreApi.Archive(context.Background(), objectType, propertyName).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CoreApi.Archive``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
objectType string
propertyName string

Other Parameters

Other parameters are passed through a pointer to a apiArchiveRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

oauth2, oauth2_legacy, private_apps, private_apps_legacy

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Create

Property Create(ctx, objectType).PropertyCreate(propertyCreate).Execute()

Create a property

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    objectType := "objectType_example" // string | 
    propertyCreate := *openapiclient.NewPropertyCreate("My Contact Property", "enumeration", "contactinformation", "Name_example", "select") // PropertyCreate | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CoreApi.Create(context.Background(), objectType).PropertyCreate(propertyCreate).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CoreApi.Create``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `Create`: Property
    fmt.Fprintf(os.Stdout, "Response from `CoreApi.Create`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
objectType string

Other Parameters

Other parameters are passed through a pointer to a apiCreateRequest struct via the builder pattern

Name Type Description Notes

propertyCreate | PropertyCreate | |

Return type

Property

Authorization

oauth2, oauth2_legacy, private_apps, private_apps_legacy

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAll

CollectionResponsePropertyNoPaging GetAll(ctx, objectType).Archived(archived).Properties(properties).Execute()

Read all properties

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    objectType := "objectType_example" // string | 
    archived := true // bool | Whether to return only results that have been archived. (optional) (default to false)
    properties := "properties_example" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CoreApi.GetAll(context.Background(), objectType).Archived(archived).Properties(properties).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CoreApi.GetAll``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetAll`: CollectionResponsePropertyNoPaging
    fmt.Fprintf(os.Stdout, "Response from `CoreApi.GetAll`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
objectType string

Other Parameters

Other parameters are passed through a pointer to a apiGetAllRequest struct via the builder pattern

Name Type Description Notes

archived | bool | Whether to return only results that have been archived. | [default to false] properties | string | |

Return type

CollectionResponsePropertyNoPaging

Authorization

oauth2, oauth2_legacy, private_apps, private_apps_legacy

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetByName

Property GetByName(ctx, objectType, propertyName).Archived(archived).Properties(properties).Execute()

Read a property

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    objectType := "objectType_example" // string | 
    propertyName := "propertyName_example" // string | 
    archived := true // bool | Whether to return only results that have been archived. (optional) (default to false)
    properties := "properties_example" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CoreApi.GetByName(context.Background(), objectType, propertyName).Archived(archived).Properties(properties).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CoreApi.GetByName``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetByName`: Property
    fmt.Fprintf(os.Stdout, "Response from `CoreApi.GetByName`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
objectType string
propertyName string

Other Parameters

Other parameters are passed through a pointer to a apiGetByNameRequest struct via the builder pattern

Name Type Description Notes

archived | bool | Whether to return only results that have been archived. | [default to false] properties | string | |

Return type

Property

Authorization

oauth2, oauth2_legacy, private_apps, private_apps_legacy

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Update

Property Update(ctx, objectType, propertyName).PropertyUpdate(propertyUpdate).Execute()

Update a property

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    objectType := "objectType_example" // string | 
    propertyName := "propertyName_example" // string | 
    propertyUpdate := *openapiclient.NewPropertyUpdate() // PropertyUpdate | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CoreApi.Update(context.Background(), objectType, propertyName).PropertyUpdate(propertyUpdate).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CoreApi.Update``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `Update`: Property
    fmt.Fprintf(os.Stdout, "Response from `CoreApi.Update`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
objectType string
propertyName string

Other Parameters

Other parameters are passed through a pointer to a apiUpdateRequest struct via the builder pattern

Name Type Description Notes

propertyUpdate | PropertyUpdate | |

Return type

Property

Authorization

oauth2, oauth2_legacy, private_apps, private_apps_legacy

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, /

[Back to top] [Back to API list] [Back to Model list] [Back to README]