Files
sdk/docs/ContentAPI.md

13 KiB

\ContentAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
GetContentBoard Get /v1/content/board Aggregates the caller org's marketing content across every publishable content type into ONE queue board — the cross-type read the framework's per-DocType list cannot give.
GetContentChannels Get /v1/content/channels Lists the distribution channels the caller's org has connected — the social integrations a publish can target.
GetContentLifecycle Get /v1/content/lifecycle Returns the ONE marketing-content state machine: the ordered lifecycle states, which state a fresh document starts in, which one is publicly live, and the legal successors of every state.
PostContentByDoctypeByNameTransition Post /v1/content/{doctype}/{name}/transition Moves one content item to a new lifecycle state and, on the move to published, fans it out to the item's channels.
PostContentGenerate Post /v1/content/generate Draft a provider of marketing content and file it in the CMS as a draft.
PostContentPublish Post /v1/content/publish Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome.

GetContentBoard

ContentBoardPage GetContentBoard(ctx).Status(status).Project(project).Doctype(doctype).Limit(limit).Execute()

Aggregates the caller org's marketing content across every publishable content type into ONE queue board — the cross-type read the framework's per-DocType list cannot give.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	status := "queued" // string | Status keeps only items in one lifecycle state (draft, in_review, approved, queued, published, archived). An undefined state is refused. (optional)
	project := "project_example" // string | Project keeps only items in one brand/site sub-scope. (optional)
	doctype := "doctype_example" // string | DocType keeps only one content type; omitted, the board spans every publishable type. An unknown type is refused. (optional)
	limit := int64(50) // int64 | Limit caps the rows returned, clamped to 1000. Defaults to 200, which is also what a non-positive or unparseable value takes. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ContentAPI.GetContentBoard(context.Background()).Status(status).Project(project).Doctype(doctype).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ContentAPI.GetContentBoard``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetContentBoard`: ContentBoardPage
	fmt.Fprintf(os.Stdout, "Response from `ContentAPI.GetContentBoard`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
status string Status keeps only items in one lifecycle state (draft, in_review, approved, queued, published, archived). An undefined state is refused.
project string Project keeps only items in one brand/site sub-scope.
doctype string DocType keeps only one content type; omitted, the board spans every publishable type. An unknown type is refused.
limit int64 Limit caps the rows returned, clamped to 1000. Defaults to 200, which is also what a non-positive or unparseable value takes.

Return type

ContentBoardPage

Authorization

bearer

HTTP request headers

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

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

GetContentChannels

ContentChannelList GetContentChannels(ctx).Execute()

Lists the distribution channels the caller's org has connected — the social integrations a publish can target.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

ContentChannelList

Authorization

bearer

HTTP request headers

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

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

GetContentLifecycle

ContentStateGraph GetContentLifecycle(ctx).Execute()

Returns the ONE marketing-content state machine: the ordered lifecycle states, which state a fresh document starts in, which one is publicly live, and the legal successors of every state.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

ContentStateGraph

Authorization

bearer

HTTP request headers

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

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

PostContentByDoctypeByNameTransition

ContentTransitionResult PostContentByDoctypeByNameTransition(ctx, doctype, name).ContentTransitionIn(contentTransitionIn).Execute()

Moves one content item to a new lifecycle state and, on the move to published, fans it out to the item's channels.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	doctype := "marketing.SocialPost" // string | DocType is the content type to act on, from the path.
	name := "spring-teaser" // string | Name is the document to act on, from the path.
	contentTransitionIn := *openapiclient.NewContentTransitionIn() // ContentTransitionIn | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ContentAPI.PostContentByDoctypeByNameTransition(context.Background(), doctype, name).ContentTransitionIn(contentTransitionIn).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ContentAPI.PostContentByDoctypeByNameTransition``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostContentByDoctypeByNameTransition`: ContentTransitionResult
	fmt.Fprintf(os.Stdout, "Response from `ContentAPI.PostContentByDoctypeByNameTransition`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
doctype string DocType is the content type to act on, from the path.
name string Name is the document to act on, from the path.

Other Parameters

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

Name Type Description Notes

contentTransitionIn | ContentTransitionIn | |

Return type

ContentTransitionResult

Authorization

bearer

HTTP request headers

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

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

PostContentGenerate

ContentGenerateResult PostContentGenerate(ctx).ContentGenerateInput(contentGenerateInput).Execute()

Draft a provider of marketing content and file it in the CMS as a draft.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	contentGenerateInput := *openapiclient.NewContentGenerateInput() // ContentGenerateInput | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ContentAPI.PostContentGenerate(context.Background()).ContentGenerateInput(contentGenerateInput).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ContentAPI.PostContentGenerate``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostContentGenerate`: ContentGenerateResult
	fmt.Fprintf(os.Stdout, "Response from `ContentAPI.PostContentGenerate`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
contentGenerateInput ContentGenerateInput

Return type

ContentGenerateResult

Authorization

bearer

HTTP request headers

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

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

PostContentPublish

ContentPublishResult PostContentPublish(ctx).ContentPublishInput(contentPublishInput).Execute()

Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	contentPublishInput := *openapiclient.NewContentPublishInput() // ContentPublishInput | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ContentAPI.PostContentPublish(context.Background()).ContentPublishInput(contentPublishInput).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ContentAPI.PostContentPublish``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostContentPublish`: ContentPublishResult
	fmt.Fprintf(os.Stdout, "Response from `ContentAPI.PostContentPublish`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
contentPublishInput ContentPublishInput

Return type

ContentPublishResult

Authorization

bearer

HTTP request headers

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

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