3 Replies Latest reply on Jun 11, 2014 2:04 PM by whoiskevin

    Add attachment to existing content with V3

    agentalpha

      I'm having trouble trying to add a new attachment to an existing piece of content.  I'm able to add this same attachment when creating a new piece of content but doesn't seem to work for existing content.  I've tried many different versions of the attachment JSON but regardless of what I try I just get a '415 Unsupported Media Type' error.  I'm sure I'm sure I'm missing something small but can't figure out what it is.  Ideas?

       

      attachment = {

      "attachments": [

              {

                "url": "http://i2.cdn.turner.com/cnn/dam/assets/140611080706-02-iraqi-civilians-flee-mosul-c1-main.jpg" ,

                    "doUpload": true,

                  "contentType": "img/jpg",

              }

          ]

      }

       

      jQuery.ajax({

      type: "POST",

      url: '/api/core/v3/attachments/contents/44238',

      contentType: "application/json",

      dataType: 'json',

      data: JSON.stringify(jiveDoc),

      complete: function(data) {

        console.log('done');

      }