Expand my Community achievements bar.

SOLVED

Message Center logon to get session token

Avatar

Level 2

Hello, Thanks in advance for your help. I've been using Campaign classic for 1 year for regular email but have never used Message Center.

 

I would like to use message center to send a real time "Thank you" email on our website. Is this possible? (User enters email address on a form and instantly receives an email with special instructions.)

 

I'm following the help article but cannot create the session token or get the mc credentials to work. I also don't know when to use the rt server vs the regular campagin url. The documentation mentions using http://hostname/nl/jsp/schemawsdl.jsp?schema=nms:rtEvent for accessing the schema and other articles on this forum mention using https://hostname/nl/jsp/soaprouter.jsp.

 

The documentation link I'm using is here: https://docs.adobe.com/content/help/en/campaign-classic/using/transactional-messaging/introduction/e...

Also using this link: https://docs.adobe.com/content/help/en/campaign-classic/using/configuring-campaign-classic/api/web-s...

 

I believe I've followed all steps but still having trouble with.

 

1: "To retrieve the session token, perform a logon SOAP call, then a get token followed by a logoff."

Q: Is there a sample or snipper for how to login and actually retrieve the token?

 

2: Using Wizdler or SOAPUI, I can POST using my ACC credentials instead of the MC/xxxx password provided by support. (They provided mc creds and tracking creds and neither worked here.)

Q: How can I use this in HTML on my website (already whitelisted)? Is there a sample code for reaching the ACC API from another website form?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi Rodney,

 

You need to get the xtk:session WSDL too.


URL syntax for generating the session and rtEvent WSDL's.

  1. Generate session token WSDL http://hostname/nl/jsp/schemawsdl.jsp?schema=xtk:session
  2. Generate rtEvent WSDL http://hostname/nl/jsp/schemawsdl.jsp?schema=nms:rtEvent

Then you can use the session WSDL first to request the logon method

DavidKangni_0-1603422071456.png

Once you log in, you will need two information for your rtEvent call header: sessionToken and SecurityToken (pstrSessionToken and pstrSecurityToken from your logon response)

Add the header as in the screenshot below

  1. cookie  __sessiontoken={pstrSessionToken}
  2. X-Security-Token {pstrSecurityToken} 

DavidKangni_1-1603422600880.png

 

Just a reminder, you need some pre requirements in ACC to make the successfully. 

  1. create an event Type that will be used as type in your payload
  2. create and publish a template using your event type

Thanks

David

 



David Kangni

View solution in original post

12 Replies

Avatar

Level 1

Hi @RodneyLewis ,

 

1: "To retrieve the session token, perform a logon SOAP call, then a get token followed by a logoff." Q: Is there a sample or snipper for how to login and actually retrieve the token?

a. You can use xtk:session#Logon method available in the WSDL downloaded from http://hostname/nl/jsp/schemawsdl.jsp?schema=nms:rtEvent. Import the WSDL into SOAPUI and use credentials to send SOAP call.

 

2: Using Wizdler or SOAPUI, I can POST using my ACC credentials instead of the MC/xxxx password provided by support. (They provided mc creds and tracking creds and neither worked here.) Q: How can I use this in HTML on my website (already whitelisted)? Is there a sample code for reaching the ACC API from another website form?

a. You've to use xtk:session#Logon method to get session token

b. Then you've to use the WSDL created to make SOAP call from the website to the https://localhost/nl/jsp/soaprouter.jsp.

 

Avatar

Level 2

Hi, I'm VERY new to APIs. The part I'm not sure about is where to use xtk:session#Logon. Does it go inside the <PushEvent xmlns="urn:nms:rtEvent"> before or after the <sessiontoken>user/pass</sessiontoken>?

 

I'm pretty sure that would be before the domevent, right?

 

Any way you can post a full example or steps?

 

 

I have this so far.

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<PushEvent xmlns="urn:nms:rtEvent">
<sessiontoken>user/pass</sessiontoken>
<domEvent>
<!-- Any elements -->
</domEvent>
</PushEvent>
</Body>
</Envelope>

 

 

Avatar

Level 1

This is 2 step process.

1. Use  xtk:session#Logon to get session token with valid credentials

2. Use the session token from step 1 to make 2nd SOAP call with actual payload.

Sometimes you can use credentials directly instead of session token. I'll try to get some sample code later on.

Avatar

Level 2
Do you have an example of how to form step 1? Is it the same as step 1 but with the xtk:session#Logon somehow replacing the sessiontoken?

Avatar

Level 2

ok. I just tried adding the following BEFORE the sessiontoken and and it seems I'm getting closer. <xtk:session#Logon></xtk:session>

 

Now I'm seeing the following result: 

<faultcode>SOAP-ENV:Client</faultcode>
<faultstring xsi:type='xsd:string'>SOP-330010 The XML SOAP message is invalid (service 'PushEvent', method 'nms:rtEvent').</faultstring>

<detail xsi:type='xsd:string'>(4:25) : Expected an attribute name
XML-110018 Error while parsing XML string..

 

Is this a good sign? 

Avatar

Correct answer by
Community Advisor

Hi Rodney,

 

You need to get the xtk:session WSDL too.


URL syntax for generating the session and rtEvent WSDL's.

  1. Generate session token WSDL http://hostname/nl/jsp/schemawsdl.jsp?schema=xtk:session
  2. Generate rtEvent WSDL http://hostname/nl/jsp/schemawsdl.jsp?schema=nms:rtEvent

Then you can use the session WSDL first to request the logon method

DavidKangni_0-1603422071456.png

Once you log in, you will need two information for your rtEvent call header: sessionToken and SecurityToken (pstrSessionToken and pstrSecurityToken from your logon response)

Add the header as in the screenshot below

  1. cookie  __sessiontoken={pstrSessionToken}
  2. X-Security-Token {pstrSecurityToken} 

DavidKangni_1-1603422600880.png

 

Just a reminder, you need some pre requirements in ACC to make the successfully. 

  1. create an event Type that will be used as type in your payload
  2. create and publish a template using your event type

Thanks

David

 



David Kangni

Avatar

Level 2
Since you know, please answer one more question for me. I am also working on using the Campaign API to insert new recipients from my website (newsletter subscribers.) I assume the same session token and logon is required on the campaign server, but I'll need other methods to write the data. Do you have examples of how to achieve this? Scenario: User enters email address on web form. (godaddy hosted) Web form inserts new recipient into campaign Workflow sends them a welcome email. note: I have already whitelisted the godaddy server. Thanks

Avatar

Community Advisor

In this case the end point will be your marketing instance.

You'll need a logon method first to get the session token then you will need a write method to write in your schema

 

DavidKangni_0-1603424463307.png

You need to specify the operation and the key (example: I’m updating my gender and status using email as reconciliation key)
Here is an example of a call: <recipient xtkschema="nms:recipient" gender="Male" status="Prospect" email="david.kangni@yyyyy.com" operation="_update" _key="@email"/>

 

Thanks,

David



David Kangni

Avatar

Level 2
Got it. I've now connected to the marketing instance and have a session token. I assume the next step is xtk:write, and that I would need to specify the @email field from recipients? Is it that simple?

Avatar

Community Advisor
Yes, if you're not using an autopk then you have to specify a key in the payload.


David Kangni

Avatar

Level 2

THANK YOU SO MUCH! I was able to write a record to the recipients table. I'll pass this info to the web devs. Edit: found the field names.