My Account

Forums

Forums General Push To Custom Endpoint

Viewing 1 reply thread
  • Author
    Posts
    • #70160
      TMC Media
      Participant

      Hey!

      So I’m looking to push data to a custom endpoint. I have been able to correctly input the header api key and the data and I am sending it to the correct link.

      However, in the POST JSON, at the top, I need to wrap the form in:

      “contactType”: {
      “id”: -1,
      “name”: “Contactform”,
      “label”: “Contactform”
      },

      So the end result is

      {
      “contactType”: {
      “id”: -1,
      “name”: “Contactform”,
      “label”: “Contactform”
      },
      “companyname”: “Company”,
      “street”: “Streetname”,
      “housenumber”: “1”,
      “postalcode”: “1000AA”,
      “city”: “City”,
      “firstname”: “Firstname”,
      “lastname”: “Lastname”,
      “phone”: “0000000000”,
      “email”: “email@email.com”,
      “description”: “Test bericht”
      }

      What could I do in order to achieve this?

    • #72552
      Mark Westguard
      Keymaster

      The ‘Push to Custom Endpoint’ action doesn’t currently support multi-level data as you have described, but we have plans to extend its capabilities to do that.

      You would need to use the ‘Run WordPress Hook’ action and use some custom PHP code to achieve that currently.

      Process Submit Data with a WordPress Hook

      Out of interest, where are you pushing this data to? Perhaps it could be a contender for a new add-on 😉

      Thanks!

      Mark

Viewing 1 reply thread
  • You must be logged in to reply to this topic.

Login