Upload Attachment (Resume) in Zoho Recruit in PHP code

Upload Attachment (Resume) in Zoho Recruit in PHP code

There is a function for the upload attachment API

function uploadAttachment($candidateId, $fileAttachment) {
            $header = [
                'Authorization: Zoho-oauthtoken '.$token->access_token,
                'Content-Type: multipart/form-data',
            ];

            $url = 'https://recruit.zoho.com/recruit/v2/Candidates/'.$candidateId.'/Attachments?attachments_category=Resume';
            $ch = curl_init( $url );
            curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
            curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
            curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
            curl_setopt( $ch, CURLOPT_POST, true );
            curl_setopt( $ch, CURLOPT_POSTFIELDS, $fileAttachment);
            $json_response = curl_exec( $ch );
            curl_getinfo( $ch, CURLINFO_HTTP_CODE );
            curl_close( $ch );

            $response = json_decode( $json_response );

            return $response;
        }

However, I am not sure how to complete the method. Candidates can be created from the form from our website, but resumes are not uploaded.

Can I have assistance how I can finish this?


      • Sticky Posts

      • How to Add Users to your Organization in ZohoMail?

        A better clarity so you can create other users to start using Zoho Mail. You can directly Add Users from the Control Panel to your Organization. You can invite users with the existing email address. If the person (user) already uses ZohoCRM, then you can import users from Zoho CRM. You can also import them using a .csv file. (if you are planning to add them in Bulk)  In this topic, We will be discussing on how to Add and Invite users only.  The Import options are self explanatory. ____________________________________________________________________________________________________________