SOLVED

Webhook and Lithium Community

Go to solution
Highlighted
Anonymous
Not applicable

Webhook and Lithium Community

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Webhook and Lithium Community

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.

View solution in original post

4 REPLIES 4
Highlighted

Re: Webhook and Lithium Community

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.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Webhook and Lithium Community

Hi Sandford.

Thanks again for your help!  This solved my problem.

-Nick

Highlighted

Re: Webhook and Lithium Community

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

Highlighted

Re: Webhook and Lithium Community

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?