How to Integrate ZRecruit to Wordpress

How to Integrate ZRecruit to Wordpress

I want this feature to work, describe in this article and the answer was also given there. Now my question is How to Integrate the API to wordpress?

It will be put in a form, a page? 

Any help is gladly appreciated.


Regards,

Patrick


Basically, what you'll need to do is XML-ize your data and POST it to the API URLs they provide. I'll start out with the basic request, and we can build on the solution if you want.

<?php
    $api_key
= 'API_KEY'; // insert your API key here;
    $ticket
= 'TICKET_ID'; // your ticket here (should be with your account);
    $data
=
       
"<JobOpenings>
        <row no='1'>
        <FL val='Posting title'>$job_title</FL>
        <FL val='Client'>$client</FL>
        <FL val='Assigned recruiter'>$recruiter_id</FL>
        <FL val='Job opening status'>$job_status</FL>
        <FL val='Number of positions'>$num_positions</FL>
        <FL val='Country'>$job_country</FL>
        <FL val='Roles and responsibilities'>$job_description</FL>
        </row>
        </JobOpenings>"









;

   

?>

You'd need to populate those variables with the values you've collected from the user. Then, you need to make a POST request. You can use the WP_Http class for that:

<?php
   
if( !class_exists( 'WP_Http' ) )
        include_once
( ABSPATH . WPINC. '/class-http.php' );

    $url

= "https://recruit.zoho.com/ats/private/xml/Module/addRecords?apikey=$api_key&ticket=$ticket";
    $request
= new WP_Http;
    $result
= $request->request( $url, array( 'method' => 'POST', 'body' => $data) );