npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@adobe/aio-lib-campaign-standard

v4.0.1

Published

Adobe I/O Campaign Standard SDK

Downloads

12,885

Readme

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

Functions

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

| Param | Type | Description | | --- | --- | --- | | tenantId | string | the tenant id (your personal organization in Campaign Standard) | | apiKey | string | the API key for your Adobe I/O Campaign Standard Integration | | accessToken | string | the access token for your Adobe I/O Campaign Standard Integration |

campaignStandardCoreAPI.getAllProfiles([parameters])

Get all Profile records

Kind: instance method of CampaignStandardCoreAPI
See: getMetadataForResource

| Param | Type | Default | Description | | --- | --- | --- | --- | | [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] | Boolean | false | set to true if you have a custom filter. Defaults to false. | | [parameters.lineCount] | integer | 25 | limit the number of records to return (default is 25) | | [parameters.order] | string | | the field to order your records by (see the fields of a Profile) | | [parameters.descendingSort] | boolean | false | set to true to get results in descending order (default is ascending) |

campaignStandardCoreAPI.createProfile(profileObject)

Create a Profile record

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | profileObject | Object | see profile properties |

campaignStandardCoreAPI.updateProfile(profilePKey, profileObject)

Update a Profile record

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | profilePKey | string | the PKey property of a Profile record | | profileObject | Object | see profile properties. Only set the properties you want to update. |

campaignStandardCoreAPI.getProfile(profilePKey)

Get a Profile record

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | profilePKey | string | the PKey property of a Profile record |

campaignStandardCoreAPI.getAllServices([parameters])

Get all Service records

Kind: instance method of CampaignStandardCoreAPI
See: getMetadataForResource

| Param | Type | Default | Description | | --- | --- | --- | --- | | [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] | Boolean | false | set to true if you have a custom filter. Defaults to false. | | [parameters.lineCount] | integer | 25 | limit the number of records to return (default is 25) | | [parameters.order] | string | | the field to order your records by (see the fields of a Service) | | [parameters.descendingSort] | descendingSort | false | set to true to get results in descending order (default is ascending) |

campaignStandardCoreAPI.createService(serviceObject)

Create a Service record

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | serviceObject | Object | see service properties |

campaignStandardCoreAPI.getService(servicePKey)

Get a Service record

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | servicePKey | string | the PKey property of a Service record |

campaignStandardCoreAPI.getHistoryOfProfile(profilePKey)

Get the marketing history of a Profile

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | profilePKey | string | the PKey property of a Profile record |

campaignStandardCoreAPI.getMetadataForResource(resource)

Get the metadata information for a resource.

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | resource | string | one of profile, service, history |

campaignStandardCoreAPI.getMetadataForResourceExt(resource)

Retrieve custom resource linked to the Profile table

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | resource | string | any 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

| Param | Type | Description | | --- | --- | --- | | gdprRequest | Object | see 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

| Param | Type | Description | | --- | --- | --- | | privacyRequestDataUrl | string | this is acquired from a getGDPRRequest call | | requestInternalName | string | the 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

| Param | Type | Description | | --- | --- | --- | | eventId | string | the type of event you want to send. This depends on the event definition. | | eventBody | Object | the 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

| Param | Type | Description | | --- | --- | --- | | macTenantId | string | the Marketing Cloud Tenant ID | | eventId | string | the type of event you want to send. This depends on the event definition. | | eventBody | Object | the 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

| Param | Type | Description | | --- | --- | --- | | eventId | string | the type of event you want to send | | eventPKey | string | the 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

| Param | Type | Description | | --- | --- | --- | | macTenantId | string | the Marketing Cloud Tenant ID | | eventId | string | the type of event you want to send | | eventPKey | string | the 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

| Param | Type | Description | | --- | --- | --- | | workflowId | string | the id of the workflow |

campaignStandardCoreAPI.triggerSignalActivity(workflowTriggerUrl, [workflowParameters])

Trigger a workflow.

Kind: instance method of CampaignStandardCoreAPI
See: getWorkflow

| Param | Type | Description | | --- | --- | --- | | workflowTriggerUrl | string | the trigger url for a workflow. You can get this from a call to getWorkflow | | [workflowParameters] | Object | workflow parameters object. see the payload in the docs | | workflowParameters.source | string | the triggering request source | | workflowParameters.parameters | Object | the 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

| Param | Type | Description | | --- | --- | --- | | workflowId | string | the id of the workflow | | command | string | the 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | [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] | integer | 25 | limit the number of records to return (default is 25) | | [parameters.order] | string | | the field to order your records by (see the fields of a OrgUnitBase) | | [parameters.descendingSort] | descendingSort | false | set 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

| Param | Type | Description | | --- | --- | --- | | profilePKey | string | the PKey property of a Profile record |

campaignStandardCoreAPI.updateProfileOrgUnit(profilePKey, orgUnitPKey)

Update the orgUnit of a Profile

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | profilePKey | string | the PKey property of a Profile record | | orgUnitPKey | string | the PKey property of a OrgUnitBase record |

campaignStandardCoreAPI.updateOrgUnit(orgUnitPKey, orgUnitObject)

Update the properties of an OrgUnitBase.

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | orgUnitPKey | string | the PKey property of a OrgUnitBase record | | orgUnitObject | Object | see orgUnitBase properties. Only set the properties you want to update. |

campaignStandardCoreAPI.postDataToUrl(url, body)

Post to an absolute url.

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | url | string | the url to POST to | | body | Object | the POST body |

campaignStandardCoreAPI.getDataFromRelativeUrl(relativeUrl)

Gets data from a relative url. Helper function.

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | relativeUrl | string | the 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | customResource | string | | the 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] | Boolean | false | set to true if you have a custom filter. Defaults to false. | | [parameters.lineCount] | integer | 25 | limit the number of records to return (default is 25) | | [parameters.order] | string | | the field to order your records by (see the fields of a Profile) | | [parameters.descendingSort] | boolean | false | set to true to get results in descending order (default is ascending) |

campaignStandardCoreAPI.getAllBasicCustomResources(resource)

Get all Custom Resource records

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | resource | string | one of profile, service, history |

campaignStandardCoreAPI.getAllProfileAndServicesExt(customResource, [parameters])

Get all Custom Resource records

Kind: instance method of CampaignStandardCoreAPI
See: getMetadataForResource

| Param | Type | Default | Description | | --- | --- | --- | --- | | customResource | string | | the 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] | Boolean | false | set to true if you have a custom filter. Defaults to false. | | [parameters.lineCount] | integer | 25 | limit the number of records to return (default is 25) | | [parameters.order] | string | | the field to order your records by (see the fields of a Profile) | | [parameters.descendingSort] | boolean | false | set 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

| Param | Type | Description | | --- | --- | --- | | customResource | string | the custom resource | | customResourcePKey | string | the PKey property of a Custom Resource record | | customResourceObject | Object | A 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

| Param | Type | Description | | --- | --- | --- | | customResource | string | the custom resource | | customResourceObject | Object | a Custom Resource object |

campaignStandardCoreAPI.deleteCustomResource(customResource, customResourcePKey, customResourceObject)

Delete a Custom Resource record

Kind: instance method of CampaignStandardCoreAPI

| Param | Type | Description | | --- | --- | --- | | customResource | string | the custom resource | | customResourcePKey | string | the PKey property of a Custom Resource record | | customResourceObject | Object | a Custom Resource object |

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

Returns a Promise that resolves with a new CampaignStandardCoreAPI object.

Kind: global function

| Param | Type | Description | | --- | --- | --- | | tenantId | string | the tenant id (your personal organization in Campaign Standard) | | apiKey | string | the API key for your Adobe I/O Campaign Standard Integration | | accessToken | string | the 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.