Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Parameter substitution in webhook integration URL

    Scheduled Pinned Locked Moved Software Tools
    6 Posts 2 Posters 162 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ShanevanJS Offline
      ShanevanJ
      last edited by

      I need to substitute a device name into the web hook URL where it says DEVICE_NAME below - is this possible?

      https://webhook.site/b2b7af39-b94f-4677-9542-d8dd549476a2/api/v1/DEVICE_NAME/telemetry
      

      Design | Develop | Deploy

      1 Reply Last reply Reply Quote 0
      • J Offline
        johand
        last edited by

        @ShanevanJ said in Parameter substitution in webhook integration URL:

        https://webhook.site/b2b7af39-b94f-4677-9542-d8dd549476a2/api/v1/DEVICE_NAME/telemetry

        "https://webhook.site/b2b7af39-b94f-4677-9542-d8dd549476a2/api/v1/{}/telemetry".format("MyDevice")

        Johan

        ShanevanJS 2 Replies Last reply Reply Quote 1
        • ShanevanJS Offline
          ShanevanJ @johand
          last edited by

          @johand Thank you - I am a python noob so I should have guessed the solution would be pythonic ! (how do we add this to the documentation for the web hooks - would save a lot of time!)

          Design | Develop | Deploy

          1 Reply Last reply Reply Quote 0
          • ShanevanJS Offline
            ShanevanJ @johand
            last edited by ShanevanJ

            @johand - Ah I was too quick here ...

            The integration page shows the new url as this

            Endpoint Address
            https://webhook.site/b2b7af39-b94f-4677-9542-d8dd549476a2/apiv1/{}/telemetry.format(MyDevice)

            • No "{}"

            and it won't accept with leading " marks either

            d747a1ce-8634-4edc-a762-a8bd01c9bd05-image.png

            Design | Develop | Deploy

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              johand @ShanevanJ
              last edited by

              @ShanevanJ Is this Pybytes webhook? I thought it was something you were doing on the device... Maybe you can post to your own service and there convert to a request with the device name in the url. I looks like there will be some kind of device id in the request body.

              ShanevanJS 1 Reply Last reply Reply Quote 0
              • ShanevanJS Offline
                ShanevanJ @johand
                last edited by

                @johand Yes it is on pybytes - sorry for confusion - I am trying to move from particle.io platform and gain similar functionality. I will keep looking around for a solution

                Design | Develop | Deploy

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom