Supported extensions for the parsing API are .pdf, .png, .jpg, .jpeg, .bmp, .doc, .docx, .odt, .rtf, .odp, ppt, and .pptx .
{"code": 201,"message": "Profile parsed successfully. Profile extraction finished : 7.279723644256592 seconds.","data": {"parsing": {...},"profile": {...}}}
{"code": 202,"message": "Your profile as been sent successfully to the Parsing Queue.","data": []}
{"code": 400,"message": "Invalid source fields"}
{"code": 401,"message": "Unauthorized. Invalid secret key: xxxx for permission: write"}
While uploading a profile file you can use either synchronous or asynchronous parsing:
As explained in this diagram, parsing ** will be done asynchronously** as soon as it is available. Then you will receive a webhook notification for success or failure of profile parsing.
Synchronous parsing:
For synchronous parsing , you will receive Profile and Parsing object in the response body.
sync_parsing is an optional request parameter , you can set its value to 1 to use sync parsing or set its value to 0 to use async parsing.
The default behavior uses asynchronous parsing.
So as to Use Sync Parsing, you need to:
Create an API source (HTTP / Python / PHP ...),
Enable sync_parsing
for a given Source :
Your admin must activate sync_parsing
in source's configuration,
Send a request to HrFlow support team in order to enable this feature for you.
Set sync_parsing
to 1 in your request
A profile ID is a unique identifier for a HrFlow Profile. This information is mandatory, profile_key
guarantees the processing of your profile (parsing, revealing, embedding, etc).
How to get a profile_key
If you are using SyncParsing you will receive profile_key in the response's body and if you are using the AsyncParsing you have 3 possible ways that help you retrieve this information.
Upload your document with a reference
, thus you can get profile's parsing from this endpoint using source_key
and reference
,
Set up a webhook that listens to all incoming notifications from HrFlow. As soon as your document is well parsed you will receive a success event including the profile id,
Use HrFlow's Profile Search Engine, in order to find profile's details, then you can fetch for profile_key.
The first 10 pages are parsed for documents with more than 10 pages.
from hrflow import Hrflow​client = Hrflow(api_secret="Your API Key", api_user="Your API user email")​with open('/path/to/file.pdf','rb') as file:profile_file = file.read()​client.profile.parsing.add_file(source_key="source_key",profile_file=profile_file,profile_content_type='application/pdf',reference='profile_reference',tags=[{"name":"blacklist","value":True}],metadatas=[{"name":"mail","value":"[email protected]"}],created_at="2020-01-01T00:00:00",sync_parsing=0,sync_parsing_indexing=1,webhook_parsing_sending=0)
import * as fs from 'fs';import Hrflow from 'hrflow';const client = new Hrflow({api_secret: 'Your API Key',api_user: 'Your API user email',});​client.profile.parsing.addFile('source_key',fs.createReadStream('path to your file'), {sync_parsing: 1,created_at: '2016-01-01T00:00:00',metadatas: [{'name':'mail','value':'[email protected]'}],profile_content_type: 'application/pdf',profile_reference: 'profile_reference',labels: [{'job_key': 'job_key','job_reference': 'test','stage': 'yes','stage_timestamp':1585662186,'rating':0.5,'stage_timestamp':1585662186},],tags: [{ name: 'blacklist', value: true}],}).then(response => {console.log(response);});