8 Replies Latest reply on Aug 8, 2016 12:19 AM by d7fac1d574476c45c52533b173847b31af0eea32

    Self Referencing Webhook Timeout

    Robb Barrett

      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



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

      Request Type: POST









      "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:






      Webhook Name:



      Multiple Product Interest Population



      Request Type:













      { "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:





        • Re: Self Referencing Webhook Timeout

          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.



          • Re: Self Referencing Webhook Timeout
            Sanford Whiteman

            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?

            • Re: Self Referencing Webhook Timeout
              Robb Barrett

              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.

                • Re: Self Referencing Webhook Timeout
                  Sanford Whiteman

                  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).

                  1 of 1 people found this helpful
                  • Re: Self Referencing Webhook Timeout

                    Sanford Whiteman is correct in saying that loopback is not supported, and even if it was, you'd have to constantly update the access_token.

                    An easy option would be to use something like Zapier (https://zapier.com/ ).


                    You can have the Marketo Webhook, send the data to a Zapier webhook, have Zapier authenticate itself with your Custom Service's details (request a new access token), then post the data back to your custom object REST endpoint along with the new access token. Zapier's able to capture the data you send it in the initial Marketo Webhook, then get the auth token, then map the data from the call and the token to the final webhook template.


                    You don't really need to code anything, just fiddle with setting up the json templates in the right way.

                    I've done this to create some many-to-many relationships in Marketo and it seems to work fine.


                    From an audit view, it will also keep a record of all the calls received and what it did with those.