Adobe Campaign JavaScript SDK

HTTP Headers

Out-of-the-box headers

In version 1.1.3 and above, the SDK will pass additional HTTP headers automatically

Header Comment / Description
SOAPAction name of the schema and SOAP method (ex: xtk:query#ExecuteQuery)
ACC-SDK-Version Version of the SDK making the scores
ACC-SDK-Auth Authentification type and ACC user
ACC-SDK-Client-App Name of the application calling the client SDK
ACC-SDK-Call-RetryCount In case an API call is retried, indicates the number of retries
ACC-SDK-Call-Internal Indicates that an API call is performed byt the SDK for its own purpose

The ACC-SDK headers can be removed using the connection parameter noSDKHeaders.

Custom HTTP headers

In version 1.1.3 and above, it is possible to pass additional HTTP headers or override HTTP headers set by the SDK. This can be done globally (i.e. for all API calls), or locally, i.e. just for a particular call, or both.

Http headers are passed through an object whose keys represent the header name and values the corresponding header value. Nothing particular is done in term of case sensitivity, headers will be passed as passed.

To set global HTTP headers for all API calls of a client, pass an http headers array in the connection parameters

const connectionParameters = sdk.ConnectionParameters.ofUserAndPassword(
                                    "https://myInstance.campaign.adobe.com", 
                                    "admin", "admin",
                                    { extraHttpHeaders: {
                                        "X-ACC-JS-SDK-LBSAFE": "1",
                                        "X-ACC-WEBUI-VERSION: "1.2"
                                    } });

Subsequent API calls will have the corresponding headers set.

To set more HTTP headers for a particular API call, use the "headers" method of the NLWS object.

const query = client.NLWS
    .headers({'X-Test': 'hello'})
    .xtkQueryDef.create(queryDef);
await query.executeQuery();