Adobe Campaign - Delivery connector js for Routing | Community
Skip to main content
somasundaram_h
Community Advisor
Community Advisor
September 6, 2019
Solved

Adobe Campaign - Delivery connector js for Routing

  • September 6, 2019
  • 6 replies
  • 9784 views

Team,

We wanted to make use of Delivery and to use Custom Routing method(such as javascript connector) for processing API requests.

- We're trying to integrate other API's in Adobe campaign.

- We're able to connect to those API and send messages using workflows

- Now we want to use Delivery and input targetted addresses in the Delivery target

- Then in the backend we want to process API request using connector

- We tried to use Mobile App push connector for reference. Setting up mobile app channel

- However we failed to complete custom js connector(Attached error image for reference)

- If we execute the same code using workflows, it's working. If I use the same code in connector js, it's not working. Any idea please?

The following are the important code snippet in the delivery connector we believe:

loadLibrary("xtk:shared/nl.js");

NL.require('/nl/core/shared/xtk.js')

  .require('/nl/core/shared/js.js');

function processDeliveryPart (deliveryPart) {

  var msgs = <messages/>;

/* API request code comes here */

  return msgs;


//-----------------------------------------------------------------------------

// Useless here, but needed by Neolane

//-----------------------------------------------------------------------------

function getStatus (xml) {

  var msgs = <messages/>;

  return msgs;

}

//-----------------------------------------------------------------------------

// Useless here, but needed by Neolane

//-----------------------------------------------------------------------------

function getMessages (xml) {

  var msgs = <messages/>;

  return msgs;

}

Thanks,

Somasundaram

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DimaKudryavtsev

Hi somasundaramhaldurai,

The error means that your JS code is attempting to convert some value into XML, probably, by using E4X. You are absolutely right about that the error originated in your processDeliveryPart function.

Please examine your function and verify that all XML-related code is correct.

If you want more context on where the error have originated, you can add some logInfo() calls into your code. Then open mtachild@<YourInstance> logfile and you will be able to find the log.

6 replies

Milan_Vucetic
Level 9
September 10, 2019

Hi,

do you have function for connecting web service and execution of request?

Also, try to include one more library: loadLibrary("xtk:shared/json2.js");

Could you, please, share full error log from the picture?

Regards,

Milan

somasundaram_h
Community Advisor
Community Advisor
September 10, 2019

Hi Milan,

Thanks for your response. I tried to include the above library as you suggested. But still the same error. I've attached the image of error in the delivery.

Status: Failed

Reason: Unreachable

Targetted address: emGvjpeuMWI:APA91bGgFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Text: Error in delivery part 1220815623: SCR-160025 JavaScript: cannot convert the value to an XML document.\

Note:

If I process the same API request in a workflow, it's working without any issues. The same address can be targetted using a workflow which works fine.

Milan_Vucetic
Level 9
September 10, 2019

Hi,

it seems that this error is returned from your function processDeliveryPart.

Could you, please, check your code inside of this function?

If you have some query inside and result stored to a variable, please check where are you using mentioned variable.

It is not similar problem, but please check this thread regarding error log An issue with creating backup packages

Regards,

Milan

DimaKudryavtsev
DimaKudryavtsevAccepted solution
Level 3
September 10, 2019

Hi somasundaramhaldurai,

The error means that your JS code is attempting to convert some value into XML, probably, by using E4X. You are absolutely right about that the error originated in your processDeliveryPart function.

Please examine your function and verify that all XML-related code is correct.

If you want more context on where the error have originated, you can add some logInfo() calls into your code. Then open mtachild@<YourInstance> logfile and you will be able to find the log.

somasundaram_h
Community Advisor
Community Advisor
September 12, 2019

Thanks so much DimaKudryavtsev​. Your reply saved lot of time for me. I'm in the next step. I'll give an update here once I achieve what I wanted.DimaKudryavtsev

Thanks,

Somasundaram

iambhosale
Level 2
April 8, 2020
In my case I am able to query the target address and send whatsapp messages using Mobile SMS delivery but I am stuck how can I create routing similar to SMS but with channel name as WhatsAPP. Have extended delivery schema and able get whatsapp channel in list but cannot move further
December 21, 2021

Hi Bhosale,

I am also trying to do same, is your issue resolved.

Regards,

Shloak C