PATCH
/
unified
/
marketing
/
content_blocks
/
{id}
import { StackOne } from "@stackone/stackone-client-ts";
import { MarketingCreateContentBlocksRequestDtoValue } from "@stackone/stackone-client-ts/sdk/models/shared";

const stackOne = new StackOne({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await stackOne.marketing.updateContentBlock({
    id: "<id>",
    xAccountId: "<id>",
    marketingCreateContentBlocksRequestDto: {
      type: {
        value: MarketingCreateContentBlocksRequestDtoValue.Html,
        sourceValue: "text",
      },
      passthrough: {
        "other_known_names": "John Doe",
      },
    },
  });

  // Handle the result
  console.log(result);
}

run();
{
  "statusCode": 201,
  "message": "Record created successfully.",
  "timestamp": "2021-01-01T01:01:01.000Z",
  "data": {
    "id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
    "remote_id": "8187e5da-dc77-475e-9949-af0f1fa4e4e3"
  }
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Headers

x-account-id
string
required

The account identifier

Path Parameters

id
string
required

Body

application/json
name
string | null
tags
string[] | null
content
string | null
type
object

Stackone enum identifying the type of content block.

passthrough
object | null

Value to pass through to the provider

Example:
{ "other_known_names": "John Doe" }

Response

200
application/json
Record updated successfully
statusCode
number
required
Example:

201

message
string
required
Example:

"Record created successfully."

timestamp
string
required
Example:

"2021-01-01T01:01:01.000Z"

data
object
required