Note Creation

Forum for users and developers of Bullhorn's API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
lloydevaporate
User
Posts: 10
Joined: Fri May 17, 2019 8:20 am
Contact:

Note Creation

Post by lloydevaporate » Mon Jun 17, 2019 4:46 am

Hi,

Running through my services and I'm really running into some issues as I was advised I would be :lol:

I'm at a bit of a deadend, I've exhausted the docs and there seems to be just no real reference guide for note creation. The error messages are also super vague which is always helpful.

My code is below and the response is underneath that (not that it's helpful in the slightest 👌)
Code:

Code: Select all

    // Build the note from the mishmash of bullhorn junk
    $type       = $_POST['entityType'] ?? die("entityType failed");
    $id         = $_POST['entityId'];
    $action     = $_POST['action'];
    $comment    = $_POST['notesArea'];

    $note = [
        'action' => $action,
        'commentingPerson' => ['id' => $_COOKIE['userId']], // who owns this note
        $type => [['id' => $id]], // who is the note attached to
        'comments' => $comment, // comment duh 
        //'personReference' => ['id' => 2] // the CENSORED is this?
    ];

    sendNote($note);

function sendNote($note)
{
    $token = $_COOKIE['BhRestToken'];
    $url = $_COOKIE['restUrl'] ?? "https://rest23.bullhornstaffing.com/rest-services/3rn5us/";
    $url = $url . "Note&BhRestToken=$token";

    $ch = curl_init($url);

    curl_setopt($ch, CURLOPT_PUT, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($note));
    
    // dbg
    print_r($note);
    curl_setopt($ch, CURLOPT_HEADER, 1);

    $response = curl_exec($ch);

    echo $response;
}
Response

Code: Select all

Array ( [action] => Email [commentingPerson] => Array ( [id] => myUserID ) [ClientCorporation] => Array ( [0] => Array ( [id] => 2 ) ) [comments] => Eggpo ) 
HTTP/1.1 100 Continue HTTP/1.1 500 Internal Server Error Server: AkamaiGHost Mime-Version: 1.0 Content-Type: text/html Content-Length: 177 Expires: Mon, 17 Jun 2019 08:45:14 GMT Date: Mon, 17 Jun 2019 08:45:14 GMT Connection: close An error occurred while processing your request.
Reference #179.6c1e1602.1560761114.1243fa59
TIA

agrossman
User
Posts: 7
Joined: Thu Jul 19, 2018 12:21 pm

Re: Note Creation

Post by agrossman » Mon Jun 17, 2019 12:34 pm

Hi lloydevaporate,

I believe you may find the following thread useful:

viewtopic.php?f=104&t=22925&p=68298&hil ... %2A#p68298

Could you please look that over and let me know if you have any questions?
Alice Grossman
Enterprise Support Analyst
B U L L H O R N

Bullhorn Support Contact Numbers
US: 617-478-9126
UK: 44 800 032 2848
Australia: 61 28 073 5089
International: 617-478-9131

lloydevaporate
User
Posts: 10
Joined: Fri May 17, 2019 8:20 am
Contact:

Re: Note Creation

Post by lloydevaporate » Tue Jun 18, 2019 3:33 am

Ah fab, I'll take a look over it.

Thanks,
Lloyd

Post Reply