0 Replies Latest reply on Apr 24, 2018 12:55 PM by gbrettmiller

    Can I associate a tag with a stream via API

    gbrettmiller

      I am trying to use the REST API to provide a button that when clicked by a user will create a new custom stream, enable email notifications for the stream, and associate tags with that stream. I have the first two parts, but am having trouble with the third (tag association). Does anyone know how to do this? Is it even possible?

       

      In what I currently have I am able to associate a place with the newly created stream by passing its URI in an array through the API POST call.

       

        var array = ["https://jive/api/core/v3/places/2711757"];
              dataString = JSON.stringify(array);
      

       

      So I figured I should be able to do the same with a tag, so I added one to the array:

       

      var array = ["https://jive/api/core/v3/places/2711757", "https://jive/api/core/v3/tags/165589/"];

       

      When I ran this, the stream was created and the place was associated, but the tag threw a 400 error:

      1. message:"Invalid object URI https://www.milsuite.mil/book/api/core/v3/tags/165586"

       

      Which leads me to believe the URI is wrong for the tag, and the question: What is the proper URI for a tag.

       

      This particular URI I found by

      • Creating a new custom stream
      • Manually associated the tag with the stream
      • Went to /api/core/v3/streams/{streamID}/associations for this stream
      • Copied the {tagID} for the tag (I viewed api/core/v3/tags/{tagID} just to make sure it was the right one

       

      All of which means either:

      • that is not the proper URI to use to associate a tag with a stream using the API 
      • OR
      • you can't associate a tag with a stream via the API.

       

       

      Any and all insight, ideas, or answers are - as always - greatly appreciated.