2.1.0 • Published 10 months ago

@adobe/aio-lib-audience-manager-cd v2.1.0

Weekly downloads
140
License
Apache-2.0
Repository
github
Last release
10 months ago

This repository is deprecated and is no longer maintained.


Version Downloads/week Node.js CI License Codecov Coverage

Adobe I/O Audience Manager Customer Data SDK

Node Javascript SDK wrapping the Audience Manager Customer Data API.

More details on the API can be found here.

Installing

$ npm install

Usage

1) Initialize the SDK

const sdk = require('@adobe/aio-lib-audience-manager-cd')

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

2) Call methods using the initialized SDK

const sdk = require('@adobe/aio-lib-audience-manager-cd')

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

  // call methods
  try {
    // Get profiles
    const result = await client.audienceManagerCDClient.getProfile({})
    console.log(result)

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

All methods available under the SDK are documented here

Classes

Functions

AudienceManagerCDCoreApi

This class provides methods to call Adobe Audience Manager Customer Data APIs. Before calling any method initialize the instance by calling the init method on it with valid values for orgId, apiKey and accessToken.

Kind: global class

audienceManagerCDCoreApi.orgId : string

the organization id.

Kind: instance property of AudienceManagerCDCoreApi

audienceManagerCDCoreApi.apiKey : string

the API key for your integration.

Kind: instance property of AudienceManagerCDCoreApi

audienceManagerCDCoreApi.accessToken : string

the access token for your integration.

Kind: instance property of AudienceManagerCDCoreApi

audienceManagerCDCoreApi.init(orgId, apiKey, accessToken) ⇒ Promise.<AudienceManagerCDCoreApi>

Initializes a AudienceManagerCDCoreApi object and returns it.

Kind: instance method of AudienceManagerCDCoreApi
Returns: Promise.<AudienceManagerCDCoreApi> - AudienceManagerCDCoreApi object

ParamTypeDescription
orgIdstringthe organization id
apiKeystringthe API key for your integration
accessTokenstringthe access token for your integration

audienceManagerCDCoreApi.updateStream(streamId, body)

Data streaming: Allows multiple profile updates on the same call.

Ingest profile updates related to a given data stream.

Kind: instance method of AudienceManagerCDCoreApi

ParamTypeDescription
streamIdstringthe streamID is an alphanumeric identifier.
bodystringthe POST body.

audienceManagerCDCoreApi.updateProfile(dStreamId, params, body)

GET/POST a Data Collection: Update a single Audience Manager profile via a GET or POST request. If the body is left out the update is performed via a GET request using the params object. Otherwise, to enforce a POST request, please set the required parameters into the body object

Kind: instance method of AudienceManagerCDCoreApi

ParamTypeDefaultDescription
dStreamIdstringthe alphanumeric identifier for this stream.
paramsobject{}optional request parameters.
params.dSidArrayunique ID for a trait or a segment.
params.dTDpidArraydata source for trait evaluation. Only traits from this data source are evaluated.
params.dUuidstringunique Audience Manager user ID.
params.dMidstringspecifies the Experience Cloud ID set and used by the Experience Cloud ID service.
params.dCidstringcontains a pair of data provider ID and data provider user ID separated by %01.
params.dWsstringwrite Style indicator: how the provided signals and/or trait IDs act upon the given profile(s).
params.dLocationIdArrayone or more location id that correspond to the region where we've previously seen this user interacting with the adobe services.
bodyobjectoptional request parameters, use this instead of params to enforce a POST request.

audienceManagerCDCoreApi.getProfile(dataSourceId, id, filter)

Get Audience Manager profile: Returns aggregated information for a profile from all Audience Manager regions, including trait and segment qualification information. You can filter the requests by region to return qualification information from certain regions only.

Kind: instance method of AudienceManagerCDCoreApi

ParamTypeDefaultDescription
dataSourceIdstringthe unique identifier of the Audience Manager data source that this identity is part of.
idstring{integer} profile viewer id.
filterArray[]one or more location Ids, separated by comma, that correspond to the region(s) where profile information should be fetched from.

init(orgId, apiKey, accessToken) ⇒ Promise.<AudienceManagerCDCoreApi>

Returns a Promise that resolves with a new AudienceManagerCDCoreApi object.

Kind: global function
Returns: Promise.<AudienceManagerCDCoreApi> - a Promise with a AudienceManagerCDCoreApi object.

ParamTypeDescription
orgIdstringthe organization id.
apiKeystringthe API key for your integration.
accessTokenstringthe access token for your 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.