0 Replies Latest reply on Aug 8, 2012 5:06 AM by vdixit

    Issue with adding attachment to the document

      Hi there,

       

      I am getting this error:

       

      Internal Server Error

      return code is 500.

       

      Code is below. Please let me know how can I attach the file to the document.

       

      Thanks

      Vikas

       

      $url = 'https://<my company jiv instance>/api/core/v2/documents/1069/attachments';

      my $content = 'name=test&data=xyz';

       

      $req = HTTP::Request->new(POST => $url);

       

      $req->authorization_basic($auth_user, $auth_passwd);

       

      $req->content_type('multipart/form-data');

      $req->content_length(length($content));

       

      $req->content($content);

       

      $ua = LWP::UserAgent->new; # You might want some options here

      $res = $ua->request($req);

       

      print Dumper $res;