Webhook and Lithium Community | Community
Skip to main content
September 12, 2016
Solved

Webhook and Lithium Community

  • September 12, 2016
  • 2 replies
  • 2240 views

Hi all.

Has anyone had any experience using Webhooks with Lithiums REST API?

The issue I am having is that to use Lithium's API I need to do the following.

1. Make an initial call to Lithium with a username and password to get a session token.

2. Use the session token for the next API call to Lithium

To test this I have done the following.

1.  Create a webhook called Session Token which authenticates and saves the token to a custom field in Marketo

2.  Create a webhook called Lithium API which calls Lithiums API and passes the token captured in step 1.

3.  Set up a trigger smart campaign to call SESSION TOKEN, wait 30 seconds, then call LITHIUM API

The first API works successfully and saves the token string, the second one fails with permission issues.

My theory is each time Marketo calls the webhook, it starts a new session.

Has anyone got any ideas to call two webhooks in the same session?

Thanks

Nick

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 SanfordWhiteman

I wouldn't use the arbitrary wait step, but rather trigger on the Data Value Changes activity.  This will always fire when the (asynchronous) field update is complete. 30s may usually be long enough, but there is no guarantee that it is -- and when the value is committed within a couple of seconds, you're really slowing down your testing.

I don't know what you mean by your theory, because if a session is defined by a new session token, Marketo has no way to invalidate a session.  Webhooks themselves (as you know) are expected to be stateless.  You can look in the details for the Call Webhook activity and see easily which value was passed to the remote endpoint.

2 replies

SanfordWhiteman
New Participant
September 12, 2016
Has anyone got any ideas to call two webhooks in the same session?

And again, what do you mean by "session" if there are no other state variables (IP address, TCP connection, cookies) defining a session, other than the token itself?

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
September 12, 2016

I wouldn't use the arbitrary wait step, but rather trigger on the Data Value Changes activity.  This will always fire when the (asynchronous) field update is complete. 30s may usually be long enough, but there is no guarantee that it is -- and when the value is committed within a couple of seconds, you're really slowing down your testing.

I don't know what you mean by your theory, because if a session is defined by a new session token, Marketo has no way to invalidate a session.  Webhooks themselves (as you know) are expected to be stateless.  You can look in the details for the Call Webhook activity and see easily which value was passed to the remote endpoint.

September 12, 2016

Hi Sandford.

Thanks again for your help!  This solved my problem.

-Nick

SanfordWhiteman
New Participant
September 12, 2016

Great, pls mark as Correct so it'll show up in later searches.