Skip to main content

I am trying to hit freshdesk ticket generating api with attachments.


Request object :




$headers = array('Authorization' => 'Basic.ID),


'Content-Type'=>'multipart/form-data');


            $url = "https://domain.freshdesk.com/api/v2/tickets/<ID>";


            $request = new FormRequest();


            $request->setField('attachments', array($path));


            $request->setHeaders($headers);


            $request->setMethod("PUT");


            $request->setResource($url);




            $buzzBrowser = new \Buzz\Browser();


            $buzzBrowser->setClient(new \Buzz\Client\Curl());


            $response = $buzzBrowser->send($request, null);








My request is:




object(Buzz\Message\Form\FormRequest)#358 (8) {


  B"fields":"Buzz\Message\Form\FormRequest":private]=>


  array(1) {


    p"attachments<0]"]=>


    string(49) "/tmp/ca6f07a55a42da45096fe366fa4d2f23317e753a.png"


  }


  0"boundary":"Buzz\Message\Form\FormRequest":private]=>


  NULL


  m"method":"Buzz\Message\Request":private]=>


  string(3) "PUT"


  u"resource":"Buzz\Message\Request":private]=>


  string(63) "https://practosampleimport1.freshdesk.com/api/v2/tickets/<ticket_id>"


  1"host":"Buzz\Message\Request":private]=>


  NULL


  u"protocolVersion":"Buzz\Message\Request":private]=>


  float(1.1)


  M"headers":"Buzz\Message\AbstractMessage":private]=>


  array(2) {


    A0]=>


    string(49) "Authorization: Basic <ID>"


    >1]=>


    string(33) "Content-Type: multipart/form-data"


  }


  "content":"Buzz\Message\AbstractMessage":private]=>


  NULL


}


string(42)






The response which I am getting is :




object(Buzz\Message\Response)#365 (5) {


  /"protocolVersion":"Buzz\Message\Response":private]=>


  NULL


  t"statusCode":"Buzz\Message\Response":private]=>


  NULL


  "reasonPhrase":"Buzz\Message\Response":private]=>


  NULL


  "headers":"Buzz\Message\AbstractMessage":private]=>


  array(17) {


    r0]=>


    string(34) "HTTP/1.1 500 Internal Server Error"


    1]=>


    string(61) "Cache-Control: no-cache, no-store, max-age=0, must-revalidate"


    2]=>


    string(45) "Content-Type: application/json; charset=utf-8"


    3]=>


    string(35) "Date: Tue, 28 Mar 2017 07:45:56 GMT"


    <4]=>


    string(38) "Expires: Wed, 13 Oct 2010 00:00:00 UTC"


    >5]=>


    string(16) "Pragma: no-cache"


    6]=>


    string(35) "Set-Cookie: _x_w=19; path=/; secure"


    o7]=>


    string(33) "Status: 500 Internal Server Error"


    a8]=>


    string(48) "X-Freshdesk-API-Version: latest=v2; requested=v2"


    o9]=>


    string(30) "X-Rack-Cache: invalidate, pass"


    10]=>


    string(27) "X-RateLimit-Remaining: 4996"


    X11]=>


    string(23) "X-RateLimit-Total: 5000"


    t12]=>


    string(34) "X-RateLimit-Used-CurrentRequest: 1"


    n13]=>


    string(46) "X-Request-Id: <id


    14]=>


    string(31) "X-XSS-Protection: 1; mode=block"


    >15]=>


    string(18) "Content-Length: 52"


    <16]=>


    string(22) "Connection: keep-alive"


  }


  r"content":"Buzz\Message\AbstractMessage":private]=>


  string(52) "{"message":"We're sorry, but something went wrong."}"



Update (Apr 10): Issue was resolved through a ticket.




Hello Apurva,




Can you please help us with the X-Request ID so that we can get this checked?




Cheers!