You can delete an interview using following API endpoint:
https://api.hackerearth.com/partner/hackerearth/interviews/delete/
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.
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
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
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. inform_candidate and inform_interviewers are optional parameters. All these parameters have been explained below.
client_id and client_secret are explained above.
Type: String
Description: interview_id should be the universally unique identifier (UUID) of the interview.
Example: 49f6b922b2feee3be3ec79e88d6ff36
Type: Boolean value (True/False)
Description: The value of this field indicates whether to send interview cancellation email to the candidate. If this field is not provided, then by default inform_candidate will be True and candidate will receive interview cancellation email.
Type: Boolean value (True/False)
Description: The value of this field indicates whether to send interview cancellation email to the interviewers. If this field is not provided, then by default inform_interviewers will be True and interviewers will receive interview cancellation email.
Sample request using *python*
#!/usr/bin/env python
import json
import requests
CLIENT_ID = "abcdefghijklm123456789nopqrstuvwxyz.api.hackerearth.com"
CLIENT_SECRET = "abcdefghijklm123456789nopqrstuvwxyz"
INTERVIEW_ID = "619c63e9732e4298be5b47a2f94c2f49"
INFORM_CANDIDATE = True
INFORM_INTERVIEWERS = True
payload = {
"client_id": CLIENT_ID,
"client_secret": CLIENT_SECRET,
"interview_id": INTERVIEW_ID,
"inform_candidate": INFORM_CANDIDATE,
"inform_interviewers": INFORM_INTERVIEWERS
}
r = requests.post("https://api.hackerearth.com/partner/hackerearth/interviews/delete/", data=json.dumps(payload))
print r.json()
Using cURL
curl --data '{
"client_id": "abcdefghijklm123456789nopqrstuvwxyz.api.hackerearth.com",
"client_secret": "abcdefghijklm123456789nopqrstuvwxyz",
"interview_id": "619c63e9732e4298be5b47a2f94c2f49",
"inform_candidate": true,
"inform_interviewers": true
}' https://api.hackerearth.com/partner/hackerearth/interviews/delete/
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": []
}
Type : String
Description: The message code abbreviated as mcode.
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 |
Type: List
Description: The error codes are abbreviated as ecode.
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. |
ENDEDINTERVIEWDELETIONDENIED | You cannot delete an interview that has ended. |
RATELIMITEXCEEDED | The rate at which the API requests are made has reached. Please try again after some time. |
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 delete an interview, 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 interview has ended, then the JSON response that is returned is as follows:
{
"message": "Request failed",
"ecode": [
"ENDEDINTERVIEWDELETIONDENIED"
],
"emessage": [
"You cannot delete an interview that has ended."
],
"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