Announcement

Collapse
No announcement yet.

Is there an API for HSBuddy?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Is there an API for HSBuddy?

    I've looked everywhere for a scripting reference but can't seem to find it.

    I'm looking for a way to call HSBuddy from a Script (C# would be nice) that I can use to trigger a push notification to a phone/watch. I can't just call it from the event as the script can send different messages and strings depending on what it finds.

    Is there a user guide or programming API document anywhere? What can be specified in the HSBuddy Event dialog would be fine if the same information could be passed via some sort an exposed class that can be called by the hs.pluginfunction command.

    I.E. hs.PluginFunction("HSBuddy", "PushNotification", "phoneID", "Hello, I'm a Message", nothing)

    Thanks,
    George

    #2
    Hey there, thanks for reaching out. I documented this in the help page: https://hsbuddy.avglabs.net/pages/pu...son-api-access

    There's been a few changes in the push notifications code recently but I'm hoping the docs are still valid. Let me know if that isn't the case!

    Comment


      #3
      avargaskun Thanks so much for the pointer. I originally read it but when I saw the JSON I skipped over it. I see now that both the Plugin name, message and receiver ID is in there. I'll give it a shot when I get home and let you know.

      Really appreciate it!

      Comment


        #4
        avargaskun Well Buddy (pun intended ) after a few days of trial and error from your JSON example in the docs I was having no luck until some dumb ---- decided to actually read the documentation on how hspluginfunction worked. It was expecting an array and I was trying to send it a couple of strings. Luckily HSBuddy is a single instance plugin so I was able to just leave the instance field blank.

        The following code works great. I messed with it in VB and will be converting it to C# as that's what I'm trying to standardize any new scripts in.

        For grins, you might want to also maybe add this example on how to call HSBuddy from a script as well as from and HTTP JSON call.

        Thanks for your help..
        George

        BTW, are there any other fancy entrypoints in HSBuddy exist that might be useful from scripting?

        Code:
        [COLOR=#2980b9]Dim buddyparms(1) As String    ' Define the parameter array
        buddyparms(0) = ""             ' Send it to all my phones and watches
        buddyparms(1) = net_msg        ' Now raise some stink!
        hs.PluginFunction("HSBuddy","","SendNotification",buddyparms)[/COLOR]

        Comment


          #5
          George thank you for the update! I'll add the scripting example to the docs.

          The rest of the plugin functions are used by the app but they are not script friendly. There's a few functions that could be added to expose things to scripts like the current location of a phone, or historical values of a device.

          Comment


            #6
            The current location of a phone could be very handy.
            Thanks.

            Comment


              #7
              Originally posted by George View Post
              The current location of a phone could be very handy.
              Thanks.
              +1

              Comment

              Working...
              X