@adobe/aio-lib-campaign-standard

中文文档
4.0.3发布于 2026/03/31Apache-2.0CommonJS近 30 天下载 2.4万

Adobe I/O Campaign Standard SDK

原始使用文档
文档目录46 节
  1. Installing
  2. Usage
  3. Classes
  4. Functions
  5. CampaignStandardCoreAPI
  6. campaignStandardCoreAPI.tenantId
  7. campaignStandardCoreAPI.apiKey
  8. campaignStandardCoreAPI.accessToken
  9. campaignStandardCoreAPI.init(tenantId, apiKey, accessToken)…
  10. campaignStandardCoreAPI.getAllProfiles([parameters])
  11. campaignStandardCoreAPI.createProfile(profileObject)
  12. campaignStandardCoreAPI.updateProfile(profilePKey, profileO…
  13. campaignStandardCoreAPI.getProfile(profilePKey)
  14. campaignStandardCoreAPI.getAllServices([parameters])
  15. campaignStandardCoreAPI.createService(serviceObject)
  16. campaignStandardCoreAPI.getService(servicePKey)
  17. campaignStandardCoreAPI.getHistoryOfProfile(profilePKey)
  18. campaignStandardCoreAPI.getMetadataForResource(resource)
  19. campaignStandardCoreAPI.getMetadataForResourceExt(resource)
  20. campaignStandardCoreAPI.getCustomResources()
  21. campaignStandardCoreAPI.createGDPRRequest(gdprRequest)
  22. campaignStandardCoreAPI.getGDPRRequest()
  23. campaignStandardCoreAPI.getGDPRDataFile(privacyRequestDataU…
  24. campaignStandardCoreAPI.sendTransactionalEvent(eventId, eve…
  25. campaignStandardCoreAPI.sendTransactionalEventForMacTenantI…
  26. campaignStandardCoreAPI.getTransactionalEvent(eventId, even…
  27. campaignStandardCoreAPI.getTransactionalEventForMacTenantId…
  28. campaignStandardCoreAPI.getWorkflow(workflowId)
  29. campaignStandardCoreAPI.triggerSignalActivity(workflowTrigg…
  30. campaignStandardCoreAPI.controlWorkflow(workflowId, command)
  31. campaignStandardCoreAPI.getAllOrgUnits([parameters])
  32. campaignStandardCoreAPI.getProfileWithOrgUnit(profilePKey)
  33. campaignStandardCoreAPI.updateProfileOrgUnit(profilePKey, o…
  34. campaignStandardCoreAPI.updateOrgUnit(orgUnitPKey, orgUnitO…
  35. campaignStandardCoreAPI.postDataToUrl(url, body)
  36. campaignStandardCoreAPI.getDataFromRelativeUrl(relativeUrl)
  37. campaignStandardCoreAPI.getAllCustomResources(customResourc…
  38. campaignStandardCoreAPI.getAllBasicCustomResources(resource)
  39. campaignStandardCoreAPI.getAllProfileAndServicesExt(customR…
  40. campaignStandardCoreAPI.updateCustomResource(customResource…
  41. campaignStandardCoreAPI.createCustomResource(customResource…
  42. campaignStandardCoreAPI.deleteCustomResource(customResource…
  43. init(tenantId, apiKey, accessToken) ⇒ Promise.<CampaignStan…
  44. Debug Logs
  45. Contributing
  46. Licensing

Version Downloads/week Node.js CI License Codecov Coverage

Adobe I/O Adobe Campaign Standard SDK

Node Javascript SDK wrapping the Adobe Campaign Standard APIs.

Installing

$ npm install

Usage

  1. Initialize the SDK
const sdk = require('@adobe/aio-lib-campaign-standard')

async function sdkTest() {
  //initialize sdk
  const campaignStandardClient = await sdk.init('<tenant>', 'x-api-key', '<valid auth token>')
}

Init method returns an instance of the Class CampaignStandardCoreAPI

  1. Call methods using the initialized SDK
const sdk = require('@adobe/aio-lib-campaign-standard')

async function sdkTest() {
  //initialize sdk
  const campaignStandardClient = await sdk.init('<tenant>', 'x-api-key', '<valid auth token>')

  // call methods
  try {
    // get profiles by custom filters
    result = await campaignStandardClient.getAllProfiles({
      filters: [
        'byCRMId'
      ],
      hasCustomFilter: true
    })
    console.log(result)

    // get a workflow
    result = await campaignStandardClient.getWorkflow('myWkfId')
    console.log(result)

  } catch (e) {
    console.error(e)
  }
}

All methods available under the SDK are documented here

Classes

CampaignStandardCoreAPI

This class provides methods to call Adobe Campaign Standard APIs. Before calling any method initialize the instance by calling the init method on it with valid values for tenantId, apiKey and accessToken

Functions

init(tenantId, apiKey, accessToken) ⇒ Promise.<CampaignStandardCoreAPI>

Returns a Promise that resolves with a new CampaignStandardCoreAPI object.

CampaignStandardCoreAPI

This class provides methods to call Adobe Campaign Standard APIs. Before calling any method initialize the instance by calling the init method on it with valid values for tenantId, apiKey and accessToken

Kind: global class

campaignStandardCoreAPI.tenantId

the tenant id (your personal organization in Campaign Standard)

Kind: instance property of CampaignStandardCoreAPI

campaignStandardCoreAPI.apiKey

the api key from your Adobe I/O Campaign Standard integration

Kind: instance property of CampaignStandardCoreAPI

campaignStandardCoreAPI.accessToken

the access token from your Adobe I/O Campaign Standard integration

Kind: instance property of CampaignStandardCoreAPI

campaignStandardCoreAPI.init(tenantId, apiKey, accessToken) ⇒ CampaignStandardCoreAPI

Initializes this object.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
tenantIdstringthe tenant id (your personal organization in Campaign Standard)
apiKeystringthe API key for your Adobe I/O Campaign Standard Integration
accessTokenstringthe access token for your Adobe I/O Campaign Standard Integration

campaignStandardCoreAPI.getAllProfiles([parameters])

Get all Profile records

Kind: instance method of CampaignStandardCoreAPI
See: getMetadataForResource

ParamTypeDefaultDescription
[parameters]Object{}parameters to pass
[parameters.filters]Array[]apply the filters to the results. List of filters for a resource can be retrieved via a getMetadataForResource call
[parameters.hasCustomFilter]Booleanfalseset to true if you have a custom filter. Defaults to false.
[parameters.lineCount]integer25limit the number of records to return (default is 25)
[parameters.order]stringthe field to order your records by (see the fields of a Profile)
[parameters.descendingSort]booleanfalseset to true to get results in descending order (default is ascending)

campaignStandardCoreAPI.createProfile(profileObject)

Create a Profile record

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
profileObjectObjectsee profile properties

campaignStandardCoreAPI.updateProfile(profilePKey, profileObject)

Update a Profile record

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
profilePKeystringthe PKey property of a Profile record
profileObjectObjectsee profile properties. Only set the properties you want to update.

campaignStandardCoreAPI.getProfile(profilePKey)

Get a Profile record

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
profilePKeystringthe PKey property of a Profile record

campaignStandardCoreAPI.getAllServices([parameters])

Get all Service records

Kind: instance method of CampaignStandardCoreAPI
See: getMetadataForResource

ParamTypeDefaultDescription
[parameters]Object{}parameters to pass
[parameters.filters]Array[]apply the filters to the results. List of filters for a resource can be retrieved via a getMetadataForResource call
[parameters.hasCustomFilter]Booleanfalseset to true if you have a custom filter. Defaults to false.
[parameters.lineCount]integer25limit the number of records to return (default is 25)
[parameters.order]stringthe field to order your records by (see the fields of a Service)
[parameters.descendingSort]descendingSortfalseset to true to get results in descending order (default is ascending)

campaignStandardCoreAPI.createService(serviceObject)

Create a Service record

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
serviceObjectObjectsee service properties

campaignStandardCoreAPI.getService(servicePKey)

Get a Service record

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
servicePKeystringthe PKey property of a Service record

campaignStandardCoreAPI.getHistoryOfProfile(profilePKey)

Get the marketing history of a Profile

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
profilePKeystringthe PKey property of a Profile record

campaignStandardCoreAPI.getMetadataForResource(resource)

Get the metadata information for a resource.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
resourcestringone of profile, service, history

campaignStandardCoreAPI.getMetadataForResourceExt(resource)

Retrieve custom resource linked to the Profile table

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
resourcestringany custom resource

campaignStandardCoreAPI.getCustomResources()

Get all the custom resource collections linked to the Profile table.

Kind: instance method of CampaignStandardCoreAPI

campaignStandardCoreAPI.createGDPRRequest(gdprRequest)

Create a new GDPR request.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
gdprRequestObjectsee the properties that are needed.

campaignStandardCoreAPI.getGDPRRequest()

Get data about the current GDPR request.

Kind: instance method of CampaignStandardCoreAPI

campaignStandardCoreAPI.getGDPRDataFile(privacyRequestDataUrl, requestInternalName)

Get the GDPR data file.

Kind: instance method of CampaignStandardCoreAPI
See: getGDPRRequest

ParamTypeDescription
privacyRequestDataUrlstringthis is acquired from a getGDPRRequest call
requestInternalNamestringthe request internal name

campaignStandardCoreAPI.sendTransactionalEvent(eventId, eventBody)

Deprecated

Send a transactional event. Deprecated since 2.1.0. use sendTransactionalEventForMacTenantId instead.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
eventIdstringthe type of event you want to send. This depends on the event definition.
eventBodyObjectthe event data to send. This depends on the event definition.

campaignStandardCoreAPI.sendTransactionalEventForMacTenantId(macTenantId, eventId, eventBody)

Send a transactional event for a Marketing Cloud Tenant ID

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
macTenantIdstringthe Marketing Cloud Tenant ID
eventIdstringthe type of event you want to send. This depends on the event definition.
eventBodyObjectthe event data to send. This depends on the event definition.

campaignStandardCoreAPI.getTransactionalEvent(eventId, eventPKey)

Deprecated

Gets data about a transactional event (status, properties) Deprecated since 2.1.0. use getTransactionalEventForMacTenantId instead.

Kind: instance method of CampaignStandardCoreAPI
See: sendTransactionalEvent

ParamTypeDescription
eventIdstringthe type of event you want to send
eventPKeystringthe PKey of an event (you get this from a sendTransactionalEvent call)

campaignStandardCoreAPI.getTransactionalEventForMacTenantId(macTenantId, eventId, eventPKey)

Gets data about a transactional event for a Marketing Cloud Tenant ID (status, properties)

Kind: instance method of CampaignStandardCoreAPI
See: sendTransactionalEvent

ParamTypeDescription
macTenantIdstringthe Marketing Cloud Tenant ID
eventIdstringthe type of event you want to send
eventPKeystringthe PKey of an event (you get this from a sendTransactionalEvent call)

campaignStandardCoreAPI.getWorkflow(workflowId)

Gets the properties of a workflow.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
workflowIdstringthe id of the workflow

campaignStandardCoreAPI.triggerSignalActivity(workflowTriggerUrl, [workflowParameters])

Trigger a workflow.

Kind: instance method of CampaignStandardCoreAPI
See: getWorkflow

ParamTypeDescription
workflowTriggerUrlstringthe trigger url for a workflow. You can get this from a call to getWorkflow
[workflowParameters]Objectworkflow parameters object. see the payload in the docs
workflowParameters.sourcestringthe triggering request source
workflowParameters.parametersObjectthe parameters to send to the workflow (paramater name, and parameter value pairs)

campaignStandardCoreAPI.controlWorkflow(workflowId, command)

Controls execution of a workflow.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
workflowIdstringthe id of the workflow
commandstringthe command to execute for the workflow. one of start, pause, resume, stop

campaignStandardCoreAPI.getAllOrgUnits([parameters])

Get all available orgUnits

Kind: instance method of CampaignStandardCoreAPI
See: getMetadataForResource

ParamTypeDefaultDescription
[parameters]Object{}parameters to pass
[parameters.filters]Array[]apply the filters to the results. List of filters for a resource can be retrieved via a getMetadataForResource call
[parameters.lineCount]integer25limit the number of records to return (default is 25)
[parameters.order]stringthe field to order your records by (see the fields of a OrgUnitBase)
[parameters.descendingSort]descendingSortfalseset to true to get results in descending order (default is ascending)

campaignStandardCoreAPI.getProfileWithOrgUnit(profilePKey)

Gets a Profile record (with it's orgUnit property)

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
profilePKeystringthe PKey property of a Profile record

campaignStandardCoreAPI.updateProfileOrgUnit(profilePKey, orgUnitPKey)

Update the orgUnit of a Profile

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
profilePKeystringthe PKey property of a Profile record
orgUnitPKeystringthe PKey property of a OrgUnitBase record

campaignStandardCoreAPI.updateOrgUnit(orgUnitPKey, orgUnitObject)

Update the properties of an OrgUnitBase.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
orgUnitPKeystringthe PKey property of a OrgUnitBase record
orgUnitObjectObjectsee orgUnitBase properties. Only set the properties you want to update.

campaignStandardCoreAPI.postDataToUrl(url, body)

Post to an absolute url.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
urlstringthe url to POST to
bodyObjectthe POST body

campaignStandardCoreAPI.getDataFromRelativeUrl(relativeUrl)

Gets data from a relative url. Helper function.

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
relativeUrlstringthe relative url (returned from some ACS API calls)

campaignStandardCoreAPI.getAllCustomResources(customResource, [parameters])

Deprecated

Get all Custom Resource records Either use getAllBasicCustomResources() to get custom resources or getAllProfileAndServicesExt() to get extended resource data

Kind: instance method of CampaignStandardCoreAPI
See: getMetadataForResource

ParamTypeDefaultDescription
customResourcestringthe custom resource to get records from
[parameters]Object{}parameters to pass
[parameters.filters]Array[]apply the filters to the results. List of filters for a resource can be retrieved via a getMetadataForResource call
[parameters.hasCustomFilter]Booleanfalseset to true if you have a custom filter. Defaults to false.
[parameters.lineCount]integer25limit the number of records to return (default is 25)
[parameters.order]stringthe field to order your records by (see the fields of a Profile)
[parameters.descendingSort]booleanfalseset to true to get results in descending order (default is ascending)

campaignStandardCoreAPI.getAllBasicCustomResources(resource)

Get all Custom Resource records

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
resourcestringone of profile, service, history

campaignStandardCoreAPI.getAllProfileAndServicesExt(customResource, [parameters])

Get all Custom Resource records

Kind: instance method of CampaignStandardCoreAPI
See: getMetadataForResource

ParamTypeDefaultDescription
customResourcestringthe custom resource to get records from
[parameters]Object{}parameters to pass
[parameters.filters]Array[]apply the filters to the results. List of filters for a resource can be retrieved via a getMetadataForResource call
[parameters.hasCustomFilter]Booleanfalseset to true if you have a custom filter. Defaults to false.
[parameters.lineCount]integer25limit the number of records to return (default is 25)
[parameters.order]stringthe field to order your records by (see the fields of a Profile)
[parameters.descendingSort]booleanfalseset to true to get results in descending order (default is ascending)

campaignStandardCoreAPI.updateCustomResource(customResource, customResourcePKey, customResourceObject)

Update a Custom Resource record

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
customResourcestringthe custom resource
customResourcePKeystringthe PKey property of a Custom Resource record
customResourceObjectObjectA Custom Resource object. Only set the properties you want to update.

campaignStandardCoreAPI.createCustomResource(customResource, customResourceObject)

Create a Custom Resource record

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
customResourcestringthe custom resource
customResourceObjectObjecta Custom Resource object

campaignStandardCoreAPI.deleteCustomResource(customResource, customResourcePKey, customResourceObject)

Delete a Custom Resource record

Kind: instance method of CampaignStandardCoreAPI

ParamTypeDescription
customResourcestringthe custom resource
customResourcePKeystringthe PKey property of a Custom Resource record
customResourceObjectObjecta Custom Resource object

init(tenantId, apiKey, accessToken) ⇒ Promise.<CampaignStandardCoreAPI>

Returns a Promise that resolves with a new CampaignStandardCoreAPI object.

Kind: global function

ParamTypeDescription
tenantIdstringthe tenant id (your personal organization in Campaign Standard)
apiKeystringthe API key for your Adobe I/O Campaign Standard Integration
accessTokenstringthe access token for your Adobe I/O Campaign Standard Integration

Debug Logs

LOG_LEVEL=debug <your_call_here>

Prepend the LOG_LEVEL environment variable and debug value to the call that invokes your function, on the command line. This should output a lot of debug data for your SDK calls.

Contributing

Contributions are welcome! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

版本与发布记录

@adobe/aio-lib-campaign-standard 共发布 22 个版本,首次发布于 2019/10/14;过去 12 个月发布了 1 个版本。

版本发布日期距今
4.0.3latest2026/03/317 个月前
4.0.22025/08/131.2 年前
4.0.12024/02/082 年前
4.0.02024/01/112 年前
3.0.1-pre.2024-01-08.sha-7d9124canext2024/01/082 年前
3.0.12023/07/103 年前

关于 @adobe/aio-lib-campaign-standard 的常见问题

@adobe/aio-lib-campaign-standard 是什么?

Adobe I/O Campaign Standard SDK

如何安装 @adobe/aio-lib-campaign-standard?

在项目目录运行 npm install @adobe/aio-lib-campaign-standard,或使用 pnpm add / yarn add / bun add。

@adobe/aio-lib-campaign-standard 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adobe__aio-lib-campaign-standard 是否存在。

@adobe/aio-lib-campaign-standard 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@adobe/aio-lib-campaign-standard 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@adobe/aio-lib-campaign-standard 可以商用吗?

@adobe/aio-lib-campaign-standard 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@adobe/aio-lib-campaign-standard 的下载量有多少?

根据 npm 官方下载统计,@adobe/aio-lib-campaign-standard 在 2026/10/05 – 2026/11/03 这 30 天内被下载 24,335 次,日均约 811 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adobe/aio-lib-campaign-standard 还在维护吗?

最新版本 4.0.3 发布于 2026/03/31(7 个月前);至今共发布 22 个版本,其中过去 12 个月发布了 1 个;首次发布于 2019/10/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。