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
Post /profile/parsing/file

https://api.hrflow.ai/v1/profile/parsing/file
Request
Response
Request
Headers
X-API-KEY
required
string
Authentication token
X-USER-EMAIL
required
string
User's email
Form Data Parameters
source_key
required
string
The key of the source in which the Profile will be added
file
required
object
Profile's file resume in binary format
sync_parsing
optional
integer
To enable sync parsing you set this value to 1 otherwise the value is 0
sync_parsing_indexing
optional
integer
This parameter is used when you are using sync parsing, it enables Profile indexing so this object will be available using search engine. The default value is 0
webhook_parsing_sending
optional
integer
To enable the reception of webhook notification after parsing and before indexing, you set the value to 1. The default value is 0.
content_type
optional
string
Document content type (ie application/pdf)
key
optional
string
Profile's unique identifier, it is used when you want to override an existing Parsing object.
reference
optional
string
Profile's reference, it is a unique value for a given source
created_at
optional
string
The Creation datetime in iso format
labels
optional
array
The Profile's labels to include with the object (ie [{"job_key": "job_key", "job_reference": "test", "stage": "yes", "stage_timestamp":1585662186, "rating":0.5, "stage_timestamp":1585662186}, ...])
tags
optional
array
The Profile's tags, aims to mark uploaded object (ie [{"name":"blacklist","value":true}, ...])
metadatas
optional
array
The Profile's metadata (ie [{"name":"mail","value":"test@test.com"}, ...])
Response
201: Created
Profile successfully Created using sync parsing.
{
"code": 201,
"message": "Profile parsed successfully. Profile extraction finished : 7.279723644256592 seconds.",
"data": {
"parsing": {...},
"profile": {...}
}
}
202: Accepted
Profile successfully Created using async parsing.
{
"code": 202,
"message": "Your profile as been sent successfully to the Parsing Queue.",
"data": []
}
400: Bad Request
Could not find a source matching this query.
{
"code": 400,
"message": "Invalid source fields"
}
401: Unauthorized
Invalid secret key.
{
"code": 401,
"message": "Unauthorized. Invalid secret key: xxxx for permission: write"
}

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
Python
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":"test@test.com"}],
created_at="2020-01-01T00:00:00",
sync_parsing=0,
sync_parsing_indexing=1,
webhook_parsing_sending=0)
Javascript
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':'test@test.com'}],
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);
});