Skip to main content
Robb_Barrett
Level 10
July 19, 2016
Question

Self Referencing Webhook Timeout

  • July 19, 2016
  • 3 replies
  • 4353 views

I'm trying to create a workflow that will update a custom object based off a form submission. 

I can get this to work when I try it through a straight REST call from a program like ARC, so I know I have my components created correctly.

Here's my webhook:

Custom Header:

Header: Content-Type

Value: application/json

Webhook

URL = https://529-FGG-715.mktorest.com/rest/v1/customobjects/interests_c.json?access_token=ACCESS_TOKEN

Request Type: POST

Template:

{

  "action":"createOnly",

   "lookupField":"email",

   "partitionName":"USCAN-US",

   "input":[

  {

"leadID":"{{lead.ID}}",

"productID":"{{lead.Flex Field 1}}",

"productName":"{{lead.Flex Field 2}}"

  }

]

}

Request Token Encoding: None

Response Type JSON

When I trigger a campaign that calls the webhook, I get this error on the lead record. I have no clue why it's timing out. Hoping someone can help.

Webhook Id:

19

Webhook Name:

Multiple Product Interest Population

Request Type:

http_post

url:

529-FGG-715.mktorest.com/rest/v1/customobjects/interests_c.json?access_token=ACCESS_TOKEN

payload:

{ "action":"createOnly", "lookupField":"email", "partitionName":"USCAN-US", "input":[ { "leadID":"1455478", "productID":"3", "productName":"Product Interest 3" } ] }

Error Type:

Operation timeout.

Error String:

connect() timed out!

Lead ID:

1455478

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

3 replies

July 19, 2016

Hi Rob,

Did it ever work using webhook? I mean it is not an intermittent issue right?

You may have to write an intermediate web hook service to accept webhook call and call the Rest API from the server.

Worth a try.

Rajesh

SanfordWhiteman
Level 10
July 19, 2016

Loopback POST is not supported AFAIK. The REST endpoints are either specifically firewalled off from inside or are using IPs that are not routable (which has the same effect, even if not deliberate).

You can bounce off an API gateway like AWS or Apigee to easily solve this.

But the bigger problem is the access_token. How are you managing expiration?

Robb_Barrett
Level 10
July 19, 2016

I thought this was going to be the call!  I'm not sure how to accomplish what you're suggesting. APIs and webhooks are a bit new to me (I'm a Communications major, dangit!) but I'm trying to learn this.

Robb Barrett
SanfordWhiteman
Level 10
July 19, 2016

When you use an API gateway -- a service that proxies your API calls to allow for better auditing and access control, and also to transform payloads if necessary -- the source IP of the API calls is always a public IP, rather than internal within Marketo's network.  It's not what API gateways are really for, but it's a side effect that's beneficial here.

I could set you up with an API gw endpoint easily, but I don't think that's gonna actually result in a usable system for you b/c of the access_token. Webhooks are themselves totally stateless, but you need something to manage the token across requests. That "something" could feed the token to the webhook as opposed to substituting completely for the webhook, but either way you don't have that something (something = an app that maintains the token and refreshes it).

July 19, 2016

As @Sanford Whiteman mentioned, If you write a web hook service code as 'middle man' between webhook call and Rest API call, that code can store the API tokens till expiration and reuse them between webhook calls. The same code can request new API token if it is expired. Bit more work to be done on the server unfortunately, Robb Barrett​.

See Authentication » Marketo Developers

Rajesh