NEIEP  NEIEP Online Login  

MRCompletionInfo

[POST] https://portal.neiep.org/Webservices/MRTraining.asmx/MRCompletionInfo

Retrieve information about Mechanic Required Training

Given a list of Mechanics, we'll return the full Mechanic Required Training history for each SSN.

The request payload (inData) can be in CSV or JSON format and must be encrypted.

HTTP Request Parameters

companyId This is CompanyID that you obtained from NEIEP to use the NEIEP API. Not Encrypted
inFormat This is format of the inData payload. Must be either CSV or JSON. Not Encrypted
outFormat This is format desired for the Output. Must be either CSV or JSON. Not Encrypted
inData

This is a list of IDs and SSNs of the mechanics in which you want results information. You must indicate the format of this data in the inFormat parameter.

It is important to understand the encrypting requirements of this field. See the Encryption link to the right and Examples below for details.

Examples:

CSV:

4365, 987-65-1234
812, 321-54-7890

JSON:

{
    "mechanics": [
    {
        "id": "A123",
        "ssn": "123-45-6789"
    },
    {
        "id": "567W",
        "ssn": "321-54-9876"
    }
    ]
}

Encrypted

HTTP Result Status Codes

200 Success
400 Bad Request

HTTP Result

If Result Status = 200 outFormat formatted list of Mechanic Required Training Results for the SSNs passed in inData. At least one record will be returned for each entry passed in inData.
If Result Status = 400 The error that caused that Bad Request

Mechanic Required Training Results - Data structure of the returned results. At least one of these items will be returned for every SSN passed in inData.

id The company's id for mechanic
status Possible values
  • OK
  • NO REQUIRED COURSES COMPLETED
  • Multiple people found with SSN provided for this ID. No results provided for this ID.
  • No person found with SSN provided for this ID. No results provided for this ID.
name The Lastname of he mechanic
idClassification Possible values
  • NOTMECHANIC
  • REQUIRED
  • GRANDFATHERED
courseYear The calendar year that the Course was required to be completed in.
courseScoreDate The date that the Course was completed.
SAMPLES JSON Sample
[
 {"id":"A123","status":"NO REQUIRED COURSES COMPLETED",
    "name":"Doe","idClassification":"NOTMECHANIC","courseYear":"",
    "courseScoreDate":""},
 {"id":"H456",
    "status":"No person found with SSN provided for this ID. No results provided for this ID.",
    "name":"","idClassification":"","courseYear":"","courseScoreDate":""}
]

Example Code

Mechanic Required Training Results
This class matches the data returned from this Webservice. You can use it to load JSON output into a list of these objects.
protected class OutDataMechanicCourse
{
    public string id { get; set; }                  // company's id for mechanic
    public string status { get; set; } 
    /* Possible Statuses
        OK
        NO REQUIRED COURSES COMPLETED
        Multiple people found with SSN provided for this ID. No results provided for this ID.
        No person found with SSN provided for this ID. No results provided for this ID.
    */
    public string name { get; set; }                // Last name (to help company verify identify)
    public string idClassification { get; set; }    // NOTMECHANIC; REQUIRED; GRANDFATHERED 
    public string courseYear { get; set; }          // yyyy (course year - NOT necessarily year of completion!)
    public string courseScoreDate { get; set; }     // yyyy-mm-dd
}
Calling the Webservice (C#)
string response;
string webService;
string webServiceAddress;

try
{
    WebClient client = new WebClient();

    // The user-agent setting is not always required, but it is a good idea to define it.
    client.Headers.Add("user-agent", 
            "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");

    NameValueCollection collection = new NameValueCollection();
    collection.Add("companyId", "1000"); // Company Id supplied by NEIEP upon request
    collection.Add("inFormat", "JSON");
    collection.Add("outFormat", "JSON");
    collection.Add("inData", "...encrypted payload...");

    webService = "MRCompletionInfo";
    webServiceAddress = 
            "https://neiepapi.azurewebsites.net/NEIEPApi/" + webService;

    Byte[] responseArray = 
            client.UploadValues(webServiceAddress, "POST", collection);

    response = Encoding.ASCII.GetString(responseArray);

    string responseOutput = response;
}
catch (Exception ex)
{
    throw (ex);
}