Interview Report


You can fetch the report of any interview using following API endpoint:

 https://api.hackerearth.com/partner/hackerearth/interviews/report/

Authentication

The client authentication is done using your unique client_id and client_secret.

You can refer to your Dashboard settings, for client_id and client_secret under API details.

client_id

Type: String

Description: client_id is a 67 character random key that serves as an identification for a particular client. It must be provided when communicating with the API as a parameter to the API endpoint.

Example: d8a20ae8e475209er4b1faa72ede88a174423cc2029c.api.hackerearth.com

client_secret

Type: String

Description: client_secret is a 40 character random key that serves as an identification for a particular client. It must be provided when communicating with the API as a parameter to the API endpoint.

Example: 2b0ff29f4f8751487540604cdab5611e6135f41c


Making requests

All the requests to the API must be made using the POST request method.

client_id, client_secret and interview_id are the required parameters for making the request to this API endpoint. filters is an optional parameter. All these parameters have been explained below.

client_id and client_secret are explained above.

interview_id

Type: String

Description: interview_id should be the universally unique identifier (UUID) of the interview.

Example: 49f6b922b2feee3be3ec79e88d6ff36

filters (Optional)

Type: Dictionary

Description: filters could contain interviewer_emails which would be a list of email IDs of all those interviewers whose feedbacks need to be fetched.

Sample request using *python*

#!/usr/bin/env python

import json
import requests

CLIENT_ID = "abcdefghijklm123456789nopqrstuvwxyz.api.hackerearth.com"
CLIENT_SECRET = "abcdefghijklm123456789nopqrstuvwxyz"
INTERVIEW_ID = "619c63e9732e4298be5b47a2f94c2f49"
FILTERS = {
    "interviewer_emails": ["john.smith55@gmail.com", "martha.jones66@gmail.com"]
}

payload = {
    "client_id": CLIENT_ID,
    "client_secret": CLIENT_SECRET,
    "interview_id": INTERVIEW_ID,
    "filters": FILTERS
}
r = requests.post("https://api.hackerearth.com/partner/hackerearth/interviews/report/", data=json.dumps(payload))
print r.json()

Using cURL

curl --data '{
"client_id": "abcdefghijklm123456789nopqrstuvwxyz.api.hackerearth.com",
"client_secret": "abcdefghijklm123456789nopqrstuvwxyz",
"interview_id": "619c63e9732e4298be5b47a2f94c2f49",
"filters": {
    "interviewer_emails": ["john.smith55@gmail.com", "martha.jones66@gmail.com"]
}
}' https://api.hackerearth.com/partner/hackerearth/interviews/report/


Response

The response returned will be in the JSON format. A success response status code will be 200.

Sample response

{
    "mcode": "success",
    "message": "success",
    "ecode": [],
    "emessage": [],
    "start_datetime": "2019-07-31T21:25:02+05:30",
    "end_datetime": "2019-07-31T22:30:05+05:30",
    "status": "completed",
    "interviewer_feedbacks": {
        "john.smith55@gmail.com": {
            "result": "accepted",
            "eval_params_ratings": {
                "Python": 3,
                "Django": 2,
                "Go": 4
            },
            "feedback": "Sound knowledge of data structures."
        },
        "martha.jones66@gmail.com": {
            "result": null,
            "eval_params_ratings": null,
            "feedback": null
        }
    }
}

mcode

Type : String

Description: The message code abbreviated as mcode.

message

Type: String

Description: A message for user regarding the success of request.

The message and mcode attributes are related to each other according to the following table:

mcode message
SUCCESS Request successful
FAILED Request failed

ecode

Type: List

Description: The error codes are abbreviated as ecode.

emessage

Type: List

Description: It represents a message explaining the error that occurred during request processing.

The emessage and ecode attributes are related to each other according to the following table:

ecode emessage
AUTHFAILED Authentication Failed
ACCESSERROR You are not authorized to access this feature. Please contact support@hackerearth.com.
ARGMISSING Request argument missing.
BADDATA Invalid request data.
FACECODENOTAVAILABLE FaceCode feature is not available for your company.
INTERVIEWNOTFOUND Interview not found.
RATELIMITEXCEEDED The rate at which the API requests are made has reached. Please try again after some time.

start_datetime

Type: String

Description: start_datetime would contain the start date and start time of the interview in ISO8601 date-time format.

end_datetime

Type: String

Description: end_datetime would contain the end date and end time of the interview in ISO8601 date-time format.

status

Type: String

Description: status would contain the current status of the interview. Possible values of this field are: upcoming, ongoing and completed

interviewer_feedbacks

Type: Dictionary (JSON)

Description: interviewer_feedbacks will contain interviewers emails mapped with the corresponding candidate feedbacks provided by those interviewers.

Note:
1) The value of this field would be null in case of upcoming and ongoing interviews. It would be set only in case of completed interviews.
2) interviewer_feedbacks would be returned based on the requesting user’s roles and privileges. If the requesting user is a super-admin of the company then the feedbacks corresponding to all the interviewers would be returned. Otherwise, only the feedback that was submitted by the requesting user would be returned.
3) If an interviewer hasn't submitted the candidate feedback at HackerEarth yet, then the null values will be set for all the attributes in candidate feedback dict mapped to that interviewer's email ID.
4) eval_params_ratings in any interviewer feedback would be an empty dictionary if no eval_params​ were specified while creating the interview.


Errors (Mishandled API responses)

If the client_id or client_secret attribute is incorrect, then the JSON response that is returned is as follows:

{
    "message": "Request failed",
    "ecode": [
         "AUTHFAILED"
    ],
    "emessage": [
        "Authentication Failed"
    ],
    "mcode": "FAILED"
}

If user is not authorized to fetch the interview report, then the JSON response that is returned is as follows:

{
    "message": "Request failed",
    "ecode": [
        "ACCESSERROR"
    ],
    "emessage": [
        "You are not authorized to access this feature. Please contact support@hackerearth.com."
    ],
    "mcode": "FAILED"
}

If mandatory POST arguments are not provided, then the JSON response that is returned is as follows:

{
    "message": "Request failed",
    "ecode": [
        "ARGMISSING"
    ],
    "emessage": [
        "Request argument missing: '<argument_name>'"
    ],
    "mcode": "FAILED"
}

If the provided data is invalid, then the JSON response that is returned is as follows:

{
    "message": "Request failed",
    "ecode": [
         "BADDATA"
    ],
    "emessage": [
        "Invalid request data."
    ],
    "mcode": "FAILED"
}

If FaceCode feature is not enabled for your company account, then the JSON response that is returned is as follows:

{
    "message": "Request failed",
    "ecode": [
         "FACECODENOTAVAILABLE"
    ],
    "emessage": [
        "FaceCode feature is not available for your company."
    ],
    "mcode": "FAILED"
}

If wrong interview_id is provided or the interview has already been deleted, then the JSON response that is returned is as follows:

{
    "message": "Request failed",
    "ecode": [
         "INTERVIEWNOTFOUND"
    ],
    "emessage": [
        "Interview not found."
    ],
    "mcode": "FAILED"
}

If the rate (60 per min or 5000 per day) at which API requests are made by a specific user is reached, then the JSON response that is returned is as follows:

{
    "message": "Request failed",
    "ecode": [
        "RATELIMITEXCEEDED"
    ],
    "emessage": [
        "The rate at which the API requests are made has reached. Please try again after some time."
    ],
    "mcode": "FAILED"
}

If any other issue occurred do reach us out at api@hackerearth.com

Notifications
View All Notifications

?