POST: /profile/parsing/file
This endpoint allows you to add new Profile using resume to a given source.
Supported extensions for the parsing API are .pdf, .png, .jpg, .jpeg, .bmp, .doc, .docx, .odt, .rtf, .odp, ppt, and .pptx .
post
https://api.hrflow.ai
/v1/profile/parsing/file
Post /profile/parsing/file
While uploading a profile file you can use either synchronous or asynchronous parsing:

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

What's a profile_key and how to retrieve it ?

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.

Example

Python
Javascript
1
from hrflow import Hrflow
2
3
client = Hrflow(api_secret="Your API Key", api_user="Your API user email")
4
5
with open('/path/to/file.pdf','rb') as file:
6
profile_file = file.read()
7
8
client.profile.parsing.add_file(source_key="source_key",
9
profile_file=profile_file,
10
profile_content_type='application/pdf',
11
reference='profile_reference',
12
tags=[{"name":"blacklist","value":True}],
13
metadatas=[{"name":"mail","value":"[email protected]"}],
14
created_at="2020-01-01T00:00:00",
15
sync_parsing=0,
16
sync_parsing_indexing=1,
17
webhook_parsing_sending=0)
Copied!
1
import * as fs from 'fs';
2
import Hrflow from 'hrflow';
3
const client = new Hrflow({
4
api_secret: 'Your API Key',
5
api_user: 'Your API user email',
6
});
7
8
client.profile.parsing.addFile('source_key',
9
fs.createReadStream('path to your file'), {
10
sync_parsing: 1,
11
created_at: '2016-01-01T00:00:00',
12
metadatas: [{'name':'mail','value':'[email protected]'}],
13
profile_content_type: 'application/pdf',
14
profile_reference: 'profile_reference',
15
labels: [
16
{
17
'job_key': 'job_key',
18
'job_reference': 'test',
19
'stage': 'yes',
20
'stage_timestamp':1585662186,
21
'rating':0.5,
22
'stage_timestamp':1585662186
23
},
24
],
25
tags: [{ name: 'blacklist', value: true}],
26
}).then(response => {
27
console.log(response);
28
});
Copied!
Last modified 4mo ago