RunMarketingInformationWriting

Updated at:

Writes promotional copy for e-commerce and retail.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.
    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.
  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

quanmiaolightapp:RunMarketingInformationWriting

none

*All Resource

*

NoneNone

Request syntax

POST /{workspaceId}/quanmiao/lightapp/runMarketingInformationWriting HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

No

The path parameter. For more information, see workspace ID.

w-26ca1703f6d71e6e

Request parameters

Parameter

Type

Required

Description

Example

modelId

string

No

The ID of the Large Language Model (LLM).

qwen-max qwen-plus

writingType

string

No

The writing type: generateProductTitle: Generates a product title. productTitleTranslation: Translates a product title. generateProductSummary: Generates a product summary. productRedBook: Generates a Xiaohongshu (Little Red Book) post about a product. productEvaluating: Generates a product assessment copy. circleOfFriends: Generates promotional marketing copy suitable for WeChat Moments. marketingActivities: Generates promotional copy for marketing campaigns. productAdvertisement: Generates an advertising slogan for a company or product. travel: Generates a marketing promotion article for travel. other: Other types of marketing copy.

productRedBook

customPrompt

string

No

Custom writing requirements.

The language should be elegant.

sourceMaterial

string

No

Reference content for writing.

ps5 is sony's next-generation game console, it innovatively...

customLimitation

string

No

Custom writing limitations.

No typos

inputExample

string

No

A sample of custom input material for writing.

Product name: xxx Product features: xxx

outputExample

string

No

A sample of the custom output format for writing.

Sample of writing output content

language

string

No

The target language. This parameter is used for product title translation.

en

keywords

string

No

Keywords. This parameter is used to generate product titles and summaries.

sneakers breathable shock-absorbing running

generateCount

string

No

The number of items to generate. This parameter is used to generate product titles and summaries. Valid values: 1 to 15.

5

wordCountRange

string

No

The word count range. This parameter is used for product title translation. Format: Minimum word count-Maximum word count.

10-20

otherRequirements

string

No

Other requirements. This parameter is used for the following three writing types: generateProductTitle, generateProductSummary, and productTitleTranslation.

Require the title to be concise and impactful, highlighting product features

prompt

string

No

A custom prompt. This parameter is used for controllable generation models and applies to the following writing types: generateProductTitle, generateProductSummary, and productTitleTranslation.

Please generate an attractive product title based on the keywords

extParameters

object

No

Extension parameters. This is a map structure where all parameter values are of the string type:

  • enableThinking: Specifies whether to enable the thinking mode. Valid values: "true" or "false".

  • thinkingBudget: The budget for the thinking mode. This is an integer in the string format.

  • resultFormat: The result format. This is used to set the output format.

  • incrementalOutput: Specifies whether to enable incremental output. Valid values: "true" or "false".

{ "minWordLength": "10", "maxWordLength": "50", "enableThinking": "true", "thinkingBudget": "2000" }

string

No

The parameter KEY.

LLM parameter KEY

apiKey

string

No

The API key for integration access. For more information, see Get an API key.

sk-8de1****5d73

Response elements

Element

Type

Description

Example

object

Schema of Response

end

boolean

Indicates whether the process is complete.

2024-06-21T10:29:52+08:00

header

object

The HTTP request header. The format is key1:value1, with each pair separated by a line break.

event

string

The event name.

result-generated

eventInfo

string

The event description.

Optional

requestId

string

The request ID.

436BC5AE-0573-59D8-9803-6B5FDCD3BBA1

sessionId

string

The session ID.

uqubxgqzlnf4exfektij032lgb3yvix678p232n56387aqxdo4uutdt9wstqzovvz6j3ho7wnbgye785u79yn5q3euqmsvzmqdn3nmfq2826oscjvsi43kof8b8uxufpp1x97jjukk6jd3183hy8ni6hqpskuhuascpd

taskId

string

The task ID.

13312125943232

traceId

string

The trace ID.

213e20e517049392478441155e8b2a

errorMessage

string

The error message.

Error message

payload

object

The payload of the response. This is a JSON structure that varies based on the event.

output

object

The output.

text

string

The returned written content.

playstation5 new era...

reasonContent

string

The model inference content.

Inference content

usage

object

The token details.

inputTokens

integer

The number of input tokens.

100

outputTokens

integer

The number of output tokens.

100

totalTokens

integer

The total number of tokens.

200

Examples

Success response

JSON format

{
  "end": true,
  "header": {
    "event": "result-generated",
    "eventInfo": "可空",
    "requestId": "436BC5AE-0573-59D8-9803-6B5FDCD3BBA1",
    "sessionId": "uqubxgqzlnf4exfektij032lgb3yvix678p232n56387aqxdo4uutdt9wstqzovvz6j3ho7wnbgye785u79yn5q3euqmsvzmqdn3nmfq2826oscjvsi43kof8b8uxufpp1x97jjukk6jd3183hy8ni6hqpskuhuascpd",
    "taskId": "13312125943232",
    "traceId": "213e20e517049392478441155e8b2a",
    "errorMessage": "错误消息"
  },
  "payload": {
    "output": {
      "text": "playstation5新时代的...",
      "reasonContent": "推理内容"
    },
    "usage": {
      "inputTokens": 100,
      "outputTokens": 100,
      "totalTokens": 200
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

403NoPermissionYou are not authorized to perform this action , Please check the assignment of the workspaceId.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.