Support » Plugin: WP Webhooks » Posting via url

Viewing 11 replies - 1 through 11 (of 11 total)
  • dambacher

    (@dambacher)

    Plugin Author Ironikus

    (@ironikus)

    Hey @dambacher – thank you a lot for your message!

    You currently try to set up the webhook action using GET-Parameter within the URL. This is a functionality we don’t support since URL parameters mostly cause issues for more complex strings.

    The best is if you don’t add any additional parameters to your URL (Just copy it within the plugin field).
    To actually send parameters, you need to send them within the body of a POST request.
    There, you can send them, for example, as a JSON-construct or via a form. (You can test that as well if you go to your WordPress Dashboard -> Settings -> Wp Webhooks -> Recieve Data – If you click a webhook there, you have a testing possibility, which shows you that it works. The test uses a simple form to parse the data 🙂

    Hope this helps.
    In case you have further questions, feel free to reach out at any time.

    All the best
    Jannis

    dambacher

    (@dambacher)

    Thank you.

    So if my webhook is: https://mysite.com/?wpwhpro_action=main_4919&wpwhpro_api_key=myapikey

    and I hit the webhook with a service that sends json like this:
    {
    “update_id”:xxxxxxxxxxxxx,
    “message”:{
    “message_id”:xxxxx,
    “date”:xxxxxxxxxxx,
    “title”:”This is the title”,
    “text”:”this is some text”
    }
    }

    How do I insert title and text into a post?

    Again, sorry if this is an obvious question, I’m just not quite understanding the plugin.

    Thanks again!

    Plugin Author Ironikus

    (@ironikus)

    @dambacher – you are nearly there with your code! 🙂
    Inside of our plugin, you will find under every webhook certain arguments.
    These arguments are the keys of the JSON you are going to send.
    Let’s assume you want to set the title “Sports game” and the post content “lets play all together on saturday”.
    With that data, your json would look like that:

    {
    “action”: “create_post”,
    “post_title”: “Sports game”,
    “post_content”: “lets play all together on saturday”
    }

    The only special argument you always need to define is the action. This tells our plugin which kind of webhook you are going to use. 🙂
    If you have further questions, please let me know.

    dambacher

    (@dambacher)

    Thank you.

    So if I don’t control how the json is formatted, e.g. I’m sending it from a third party api, there’s no way with the base plugin to create a post? I’d have to convert the json first.

    So, if the json is sent like this:
    {
    “update_id”:xxxxxxxxxxxxx,
    “message”:{
    “message_id”:xxxxx,
    “date”:xxxxxxxxxxx,
    “title”:”This is the title”,
    “text”:”this is some text”
    }
    }

    “title” would have to be converted to “post_title” and “text” would have to be converted to “post_content” Correct?

    Thanks again for your help!

    Plugin Author Ironikus

    (@ironikus)

    Hi @dambacher – this is correct. Our plugin requires a formatted notation for doing that. How our users mostly do this is using a third-party service like Zapier or integrate, but with our pro version, we offer something called data mapping, which can also handle simple mapping of values.
    If you can influence the output on the other side, that would be even better. 🙂
    Hope this helps.

    dambacher

    (@dambacher)

    If I can do it with the pro plugin, I’ll buy it today 🙂 Can you explain the data mapping a bit please? Would it be possible to map the values as above?

    Plugin Author Ironikus

    (@ironikus)

    @dambacher – I’m afraid this is a question I can’t proceed here since this support forum is only for plugins from WordPress.org. 🙂
    You can check out the following article tho: https://ironikus.com/docs/knowledge-base/data-mapping/
    Hope this helps.

    dambacher

    (@dambacher)

    Cool. Just purchased pro. Going to give it a shot tonight.

    Thanks

    Plugin Author Ironikus

    (@ironikus)

    Thanks a lot for supporting us @dambacher – Highly appreciate it! 🙂
    Feel free to reach out to us using our contact form for further questions.

    dambacher

    (@dambacher)

    Will do. The data mapping and code execution looks awesome.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.