Page 1 of 1

CV upload failing

Posted: Fri Mar 03, 2017 5:51 pm
by pbearne
using instructions from here http://developer.bullhorn.com/articles/ ... fromresume

The same code is working for the parseToCandidate call

the only diffence trhat I can see is that parseToCandidate is a POST and /file/Candidate/2038/raw is a PUT request

the returned error

Code: Select all


array(6) {
  ["headers"]=>
  object(Requests_Utility_CaseInsensitiveDictionary)#761 (1) {
    ["data":protected]=>
    array(7) {
      ["server"]=>
      string(17) "Apache-Coyote/1.1"
      ["access-control-allow-methods"]=>
      string(31) "GET, POST, PUT, DELETE, OPTIONS"
      ["access-control-max-age"]=>
      string(5) "86400"
      ["access-control-allow-headers"]=>
      string(33) "Content-Type, X-Requested-With, *"
      ["access-control-allow-origin"]=>
      string(1) "*"
      ["content-type"]=>
      string(30) "application/json;charset=UTF-8"
      ["date"]=>
      string(29) "Fri, 03 Mar 2017 21:49:39 GMT"
    }
  }
  ["body"]=>
  string(64) "{
  "errorCode" : 400,
  "errorMessage" : "No File Uploaded!!"
}"
  ["response"]=>
  array(2) {
    ["code"]=>
    int(400)
    ["message"]=>
    string(11) "Bad Request"
  }
  ["cookies"]=>
  array(0) {
  }
  ["filename"]=>
  NULL
  ["http_response"]=>
  object(WP_HTTP_Requests_Response)#777 (5) {
    ["response":protected]=>
    object(Requests_Response)#779 (10) {
      ["body"]=>
      string(64) "{
  "errorCode" : 400,
  "errorMessage" : "No File Uploaded!!"
}"
      ["raw"]=>
      string(440) "HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Max-Age: 86400
Access-Control-Allow-Headers: Content-Type, X-Requested-With, *
Access-Control-Allow-Origin: *
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Fri, 03 Mar 2017 21:49:39 GMT
Connection: close

{
  "errorCode" : 400,
  "errorMessage" : "No File Uploaded!!"
}"
      ["headers"]=>
      object(Requests_Response_Headers)#757 (1) {
        ["data":protected]=>
        array(7) {
          ["server"]=>
          array(1) {
            [0]=>
            string(17) "Apache-Coyote/1.1"
          }
          ["access-control-allow-methods"]=>
          array(1) {
            [0]=>
            string(31) "GET, POST, PUT, DELETE, OPTIONS"
          }
          ["access-control-max-age"]=>
          array(1) {
            [0]=>
            string(5) "86400"
          }
          ["access-control-allow-headers"]=>
          array(1) {
            [0]=>
            string(33) "Content-Type, X-Requested-With, *"
          }
          ["access-control-allow-origin"]=>
          array(1) {
            [0]=>
            string(1) "*"
          }
          ["content-type"]=>
          array(1) {
            [0]=>
            string(30) "application/json;charset=UTF-8"
          }
          ["date"]=>
          array(1) {
            [0]=>
            string(29) "Fri, 03 Mar 2017 21:49:39 GMT"
          }
        }
      }
      ["status_code"]=>
      int(400)
      ["protocol_version"]=>
      float(1.1)
      ["success"]=>
      bool(false)
      ["redirects"]=>
      int(0)
      ["url"]=>
      string(165) "https://rest1.bullhornstaffing.com/rest-services/2usp0/file/Candidate/17987/raw?BhRestToken=b7b5063c-b74d-40ec-a907-6fdcd96b5c75&externalID=Portfolio&fileType=SAMPLE"
      ["history"]=>
      array(0) {
      }
      ["cookies"]=>
      object(Requests_Cookie_Jar)#768 (1) {
        ["cookies":protected]=>
        array(0) {
        }
      }
    }
    ["filename":protected]=>
    NULL
    ["data"]=>
    NULL
    ["headers"]=>
    NULL
    ["status"]=>
    NULL
  }
}
The PUT Request including an attachment

Re: CV upload failing

Posted: Fri Mar 03, 2017 5:59 pm
by pbearne
Truncated body as it was too big to large for attachment

Code: Select all


array(4) {
  ["method"]=>
  string(3) "PUT"
  ["timeout"]=>
  int(120)
  ["headers"]=>
  array(2) {
    ["accept"]=>
    string(16) "application/json"
    ["content-type"]=>
    string(57) "multipart/mixed;boundary=71ec24c8f4da08264e2d0b7d65bd75f4"
  }
  ["body"]=>
  string(523976) "--71ec24c8f4da08264e2d0b7d65bd75f4
Content-Disposition: form-data; name="CV" filename="Paul Bearne CV  Aug2015-1.pdf"
Content-Type: application/pdf
Content-Transfer-Encoding: binary

%PDF-1.5
%µµµµ
1 0 obj
<</Type/Catalog/Pages 2 0 R/Lang(en-CA) /StructTreeRoot 55 0 R/MarkInfo<</Marked true>>>>
endobj
2 0 obj
<</Type/Pages/Count 2/Kids[ 3 0 R 52 0 R] >>
endobj
3 0 obj
<</Type/Page/Parent 2 0 R/Resources<</Font<</F1 5 0 R/F2 11 0 R/F3 13 0 R/F4 15 0 R/F5 17 0 R/F6 22 0 R/F7 27 0 R/F8 34 0 R/F9 47 0 R>>/ExtGState<</GS7 7 0 R/GS8 8 0 R>>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 9 0 R 10 0 R 24 0 R 25 0 R 26 0 R 32 0 R 33 0 R 39 0 R 40 0 R 41 0 R 42 0 R 43 0 R 44 0 R 45 0 R 46 0 R] /MediaBox[ 0 0 612 792] /Contents 4 0 R/Group<</Type/Group/S/Transparency/CS/DeviceRGB>>/Tabs/S/StructParents 0>>
endobj
4 0 obj
<</Filter/FlateDecode/Length 8724>>
stream
xœ­=isÛF–ß]åÿ€[[䎡\™”k[ÎØO<#gœZ{?@$1æ¡!!)Ú_¿ïhÝ •ÙÙÈ$ÑÇë×ï~¯ÁéÇàûïO?¼~÷&ˆN*6×Á¬ÜœüøÃüåËà‡7¯ƒ>=vúVB„‘>]=&‚þ'™æ¡Hƒ4ÑaOÖÐîÇó4¸Þ?…:Ï‚kú%³~ùñù³/³ó=+îæz¶
~(‹Ýf.ô¬œÿoðéýógg0NYO¢”“ÜžäË,°Úþëù³¿?œ}xÖR„o)õ¸"Sa–i,Bi†Uó5KðO0ÏgŸ—«€¸,Öólü¥ØÌãÙb¿ü`“Wô½h™Eaž:ƒ—›; |á[f”.­·iF±š~ÚÎOÒÙn.ä>ųÍ\Í*X}y«ù€0ëy:;è%,5ýÏO’Ù‹¹³àu±).çɬðÌ©e
á7ÁA¯Ða¤*
³Ìtø“gl!£0’n[ám‡Iâ¶õáIÌQ§mR£!õuÒšÈÂîtâm›…²x
cg8Iäë”Ä«õNÀIw<†Yr^Š§g…qf÷Œ#f@/ÆrŠ‰ÈÍa#:Ë  _©ƒÝ8è`Øøü¶Ø4œ,Ç8Y
X«rÖ

......................... trunkcated

trailer
<</Size 676/Root 1 0 R/Info 54 0 R/ID[<2125EEE0F5D33B4F8740927F9626DDF0><2125EEE0F5D33B4F8740927F9626DDF0>] >>
startxref
509883
%%EOF
xref
0 0
trailer
<</Size 676/Root 1 0 R/Info 54 0 R/ID[<2125EEE0F5D33B4F8740927F9626DDF0><2125EEE0F5D33B4F8740927F9626DDF0>] /Prev 509883/XRefStm 508333>>
startxref
523563
%%EOF
--71ec24c8f4da08264e2d0b7d65bd75f4--

"
}