Recipient Insert using REST API Call

anurags23332948

06-12-2018

Hi Team,

I have a question around Storing Data in Adobe Campaign Classic using Web Service.

I am receiving data from REST API Call in the form of JSON Request(that contains multiple fields such as First Name, Last Name, Email Address, etc). I am able to consume the same into my ACC Instance in the form of Object after Parsing, and I am able to access the individual fields as well.

Now My question here is, How to store that data into the Recipient table?

Any advice on this would be highly appreciated .

Thanks

Anurag

Accepted Solutions (1)

Accepted Solutions (1)

anurags23332948

10-12-2018

Hi Jean-Serge,

Apologies in case of any misunderstanding, I am currently discovering how extensively we can use the product in terms of Web Services.(I have limited knowledge about webservices too , Kindly excuse me for that)

Previously, I referred to below links:-

REST API in Adobe Campaign Classic V7?

Invoking external REST API from Campaign Workflow

Considering the above post, I was able to consume the data, coming from a REST call into my system in the form on JSON Object, to which I further converted them to string individually, the pain point I am stuck on writing into Recipient schema.

I will consider the information you and davidl14970702​ have provided and will update you guys shortly with my findings with what exactly I am doing incorrect.

Thank you Jean-Serge Biron​ and davidl14970702​ for your help.

Regards,

Anurag Sindhwani

Answers (3)

Answers (3)

davidl14970702

09-12-2018

Here is some more info in the documentation: Data oriented APIs

Also, I'd recommend you ask support for the JSAPI file. This will give you access and examples of the OutOf the Box methods ACC uses. It should be downloadable in the same place you place tickets to ACC support. Oryou can just ask them.

xtk.session.Write(rcpxml); this method will write to any source schema you want. Recipient table is most common. But you may want to create a product table or a formSubmission table that holds other recipient data.

nms.subscription.Subscribe(svc,rcp,create) - this method will write to the recipient table and the subscription table.

Check the JSAPI doc for more info on how to use these.

This is a small sample to play with in a JS activity. Be sure to declare a recipient folder when you are writing people to the DB. It's very easy to write dup emails if you not using the root recipient folder.

var rcp = <recipient

    _operation="insertOrUpdate"

    _key="@email"

    xtkschema="nms:recipient"

    firstName="firstName"

    lastName="lastName3"

    email="vanilla@JStest.com"

    cust_state="TN"

    role="my NewRole" >

        <location

            address3=""

            city=""

            address4=""

            zipCode=""/>

        <folder

            name ='nmsRootRecipient'/>

    </recipient>;

   

    xtk.session.Write(rcp);

Jean-Serge_Biro

MVP

07-12-2018

Hi Anurag,

I am a bit confused by the title.

Hence, sorry if I misunderstand your use case.

ACC (classic v6/v7) only supports SOAP Web Service calls, not REST WS.
But ACS supports REST WS, not SOAP WS.

So I am not sure what version you mean?
Well, I guess it is ACC indeed.

Have you implemented a web method for nms:recipient schema extension?

Or is it the invert thing, you achieved a workflow that calls an external REST WS and you want to deal with JSON data in the workflow?
In that case, you can either use the Update activity (for simple use case) or Javascript activity with the WriteSession method or the entity Save method (depending on your logic/preference).

Regards
J-Serge