Skip to content

EvolutionJobs/DaxtraService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DaxtraService

.NET Core service to send CVs to Datxra's service.

See Daxtra's API documentation here.

Daxtra provide a reference .NET implementation, but this is compatible with .NET Core's dependency injection model.

This also serialises the result to .NET structured objects, see Model.

Installation

This package is available on NuGet:

PM> Install-Package Evolution.Daxtra -Version 1.0.0

Startup Injection

To add this service:

string url = $"https://{yourService}.daxtra.com";
string api = "/cvx/rest/api/v1"; // Or whatever version you want to use
string key = "your secret password";

services.AddDaxtraParser(url, api, key);

Using the CV Parsing Service

Then this service is available as IDaxtraParser, for instance as a Web API action:

[HttpPost("parseCV")]
public async Task<IEnumerable<Resume>> ParseCV(
    [FromServices] IDaxtraParser parser,     // Get the parser from the injected services 
    [FromForm] IEnumerable<IFormFile> files) // CV files posted from an HTML form
{
    var result = new List<Resume>();
    foreach (var f in files)
    {
        if (f.Length == 0)
             continue;

        using (var s = new MemoryStream())
        {
            await f.CopyToAsync(s);
            var parsed = await parser.Parse(s.ToArray());
            result.Add(parsed);
        }
    }

    return result;
}

Exceptions

Any errors are thrown as DaxtraException, and this contains the body of the CSERROR from the Daxtra service and the HTTP Status.

Request Details

Requests to the Daxtra service are sent as multipart/form-data and GZIP compression, as per best practice recommendation. Content are send and parsed as JSON.

Roadmap

Currently only the profile service to parse CVs is supported. We plan to introduce batch parsing next.