Interview Details


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

 https://api.hackerearth.com/partner/hackerearth/interviews/<interview_id>/

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 query 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 query parameter to the API endpoint.

Example: 2b0ff29f4f8751487540604cdab5611e6135f41c


Making requests

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

interview_id as a URL parameter and client_id and client_secret as query parameters are the required parameters for making the request to this API endpoint.

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

Sample request using *python*

#!/usr/bin/env python

import json
import requests

CLIENT_ID = "abcdefghijklm123456789nopqrstuvwxyz.api.hackerearth.com"
CLIENT_SECRET = "abcdefghijklm123456789nopqrstuvwxyz"

query_params = {
    "client_id": CLIENT_ID,
    "client_secret": CLIENT_SECRET
}
r = requests.get(
    "https://api.hackerearth.com/partner/hackerearth/interviews/ed51eb2f545245nmbf9c3e4677d87b9d/",
    params=query_params
)
print r.json()

Using cURL

curl -X GET https://api.hackerearth.com/partner/hackerearth/interviews/ed51eb2f545245nmbf9c3e4677d87b9d/?client_secret=abcdefghijklm123456789nopqrstuvwxyz&client_id=abcdefghijklm123456789nopqrstuvwxyz.api.hackerearth.com


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": [],
    "title": "Technical Interview",
    "start_datetime": "2020-05-31T21:25:02+05:30",
    "candidate_details": {
        "email_id": "sergio.marquina@gmail.com",
        "full_name": "Sergio Marquina"
    },
    "interviewers": [
        {
            "email_id": "ken.smith87@gmail.com",
            "full_name": "Ken Smith",
            "feedback_redirect_url": "https://beceptor.com/11254/feedback"
        },
        {
            "email_id": "martha.jones66@gmail.com",
            "full_name": "Martha Jones",
            "feedback_redirect_url": "https://beceptor.com/11254/feedback"
        },
        {
            "email_id": "john.smith55@gmail.com",
            "full_name": "John Smith",
            "feedback_redirect_url": "https://beceptor.com/11254/feedback"
        }
    ],
    "eval_params": [
        "Algorithms",
        "Python",
        "Number Theory"
    ]
}

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.

title

Type: String

Description: title would contain the interview title.

Example: Technical Interview

start_datetime

Type: String

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

Example: 2019-07-31T21:25:02+05:30

candidate_details

Type: Dictionary

Description: candidate_details would consist of full_name and email_id fields which contain candidate's full name and email address respectively.

interviewers

Type: List

Description: interviewers would be a list of dictionaries where each dictionary represents an interviewer's details.

Each interviewer's details would consist of full_name, email_id and feedback_redirect_url fields which contain interviewer's full name, email address and the redirect url for feedback submission respectively.

eval_params (Optional)

Type: List

Description: eval_params would be a list of strings containing evaluation parameters/criteria for 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 details, 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 GET parameters 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 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

?