NAV
cURL PHP Java

Introduction

Welcome to the InterviewApp API! This API can be use to integrate the InterviewApp service on your service and manage your candidates and your interviews on InterviewApp.

We have language bindings in Shell, Java/Scala, and PHP! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

All bindings are available on github on the interview app repo, you can make pull request if you want to make improvement or if you found bugs.

Authentication

InterviewApp uses a pair of API keys to allow access to the API. You can request your API keys on the settings panel of the InterviewApp dashboard. There is an API key and a Secret API key. Both are used to generate a unique url for each request you make on the InterviewApp API.

Auth request

DEFINITION

POST /v1/auth/
<?php
/**
 * Init api key and secret key with mail and password
 * @param $mail string
 * @param $password string
 */
Itwapp::Authenticate($mail, $password);
/**
 * Init api key and secret key with mail and password
 * @param mail
 * @param password
 */
public static void Authenticate(String mail, String password)

EXAMPLE REQUEST

curl -XPOST "https://itwapp.io/api/v1/auth/" -H "Content-Type: application/json" --data '
    {
      "mail" : "jerome@itwapp.io",
      "password" : "jeromeestleplusbeaudeshommes"
    }   
'
<?php
require_once('./lib/Itwapp.php');
Itwapp::Authenticate("jerome@itwapp.io", "jeromeestleplusbeaudeshommes");

$applicant = Applicant::findOne("53fb562418060018063095dd");
import io.itwapp.Itwapp;
try {
    AccessToken accessToken = Itwapp.Authenticate("jerome@itwapp.io", "jeromeestleplusbeaudeshommes");
    Itwapp.apiKey = accessToken.getApiKey();
    Itwapp.secretKey = accessToken.getSecretKey();
}catch(UnauthorizedException exc)   {
    // auth fails
}

You can also have keys with this api call.

HTTP Request

POST https://itwapp.io/api/v1/auth/

Body Parameters

Parameter Description
mail String
Your mail used to sign up to InterviewApp.
Any collaborator can login through this call.
password String
Your password

Result

It will respond with the API key and the Secret API key.

{
    "apiKey": "YOUR_KEY_HERE",   
    "secretKey": "SECRET_KEY"   
}
Parameter Description
apiKey
secretKey

Sign request

To authorize access to resource /api/exemple?foo=bar, use this code:

#!/bin/bash
function HmacSHA256()   {
    echo -n "$1" | openssl dgst -sha256 -hmac "$2" -binary | base64
}

function md5()  {
    echo -n "$1" | md5sum | cut -c 1-32
}

function sign()   {
    hmac=$(HmacSHA256 "$1" "$2")
    md5 $hmac
}

URL="/api/exemple?foo=bar&apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"

signature=$(sign "GET:$URL" "$KEY")

curl "https://itwapp.io$URL&signature=$signature"

## Make sure to replace `$KEY` with your Secret API key, `YOUR_KEY_HERE` with your API key.

<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

import io.itwapp.Itwapp;

Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

The generation of any URL is done by following the workflow described below. For example, let's say you want to access the resource /api/exemple?foo=bar

/api/exemple?foo=bar&apiKey=YOUR_KEY_HERE

/api/exemple?foo=bar&apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS

GET:/api/exemple?foo=bar&apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS

/api/exemple?foo=bar&apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS&signature=MD5_VALUE

https://itwapp.io/api/exemple?foo=bar&apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS&signature=MD5_VALUE

Applicant

The applicant object

The interview object JSON is structured as detailed below:

{
  "_id" : "53fb562418060018063095db",
  "mail" : "jerome@itwapp.io",
  "questions" : [
    {
      "content": "question 1",
      "readingTime": 60,
      "answerTime": 60,
      "number": 1
    }
  ],
  "responses" : [
  {
    "file": "https://video-prod-itwapp.s3.amazonaws.com/XXXXX/XXXX.mp4",
    "duration": 60,
    "fileSize": 1048576,
    "number": 1,
    "thumbnail": "https://video-prod-itwapp.s3.amazonaws.com/XXXXX/XXXX-00001.png"
  }
  ],
  "interview" : "53fb562418060018063095da",
  "dateBegin" : 1409045626568,
  "dateEnd" : 1409045926568,
  "dateAnswer" : 1409046526568,
  "emailView" : true,
  "linkClicked" : true,
  "firstname" : "Jérôme",
  "lastname" : "Heissler",
  "phone" : "0123456789",
  "lang" : "fr",
  "videoLink" : "",
  "text" : "",
  "deleted" : false,
  "callback": "https://itwapp.io",
  "status": 0
}

Attributes

_id: String
This is the applicant's unique identifier.
mail: String
This is the applicant's email.
questions: List of Questions
This is the list of questions sent to the applicant.
responses: List of Responses
This is the list of video responses for the list of questions submitted.
interview: String
The identifier of the corresponding interview.
dateBegin: Number
The date on which the interview was sent to the applicant.
dateEnd: Number
The deadline for the applicant to complete the interview.
dateAnswer: Number
The date on which the applicant completed the interview. If the applicant hasn't completed the interview yet, dateAnswer equals to 0
emailView: Boolean
It indicates if the applicant has opened the invitation email. This will only apply if an email was sent to the applicant through the InterviewApp API. See applicant creation
linkClicked: Boolean
It indicates if the applicant have clicked the link of the interview in the invitation email. It will apply only if an email was sent to the applicant through the InterviewApp API. See applicant creation
firstname: String
The applicant's first name.
lastname: String
The applicant's last name.
phone: String
The applicant's phone number.
lang: String
The language chosen for the interview.
videoLink: String
The introduction video displayed before the interview.
text: String
The short description shown before the interview.
deleted: Boolean
It indicates if the applicant has been deleted.
callback: String
The redirection URL at the end of the interview.
status: Int
Applicant status :
  • 3 completed
  • 2 in progress
  • 1 open email
  • 0 email sent
  • -1 unknown (email was not sent through Itwapp)

Get a Specific Applicant

DEFINITION

GET /v1/applicant/<ID>
<?php
/**
 * This method retrieves a specific applicant.
 * @param $id string
 * @return Applicant
 */
Applicant::findOne($id);
/**
 * @param applicantId The ID of the applicant to retrieve
 * @return the applicant
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static Applicant findOne(String applicantId) throws UnauthorizedException, InvalidRequestError, ResourceNotFoundException, ServiceException, APIException

EXAMPLE REQUEST

URL="/api/v1/applicant/53fb562418060018063095dd?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "GET:$URL" "$KEY")
curl "https://itwapp.io$URL&signature=$MD5"
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

$applicant = Applicant::findOne("53fb562418060018063095dd");
Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Applicant applicant = Applicant.findOne("53fb562418060018063095dd");

This endpoint retrieves a specific applicant.

HTTP Request

GET https://itwapp.io/api/v1/applicant/<ID>

URL Parameters

Parameter Description
ID The ID of the applicant to retrieve

Create an applicant

DEFINITION

POST /v1/applicant/
<?php
/**
 * This endpoint create an interview. It return the new interview if success.
 * @param $param string[]
 * @throws InvalidRequestError
 * @return Applicant
 */
Applicant::create($param);
/**
 * @param param
 * @return the created applicant
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static Applicant create(Map<String, Object> param) throws UnauthorizedException, InvalidRequestError, ResourceNotFoundException, ServiceException, APIException

EXAMPLE REQUEST

URL="/api/v1/applicant/?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "POST:$URL" "$KEY")
curl -XPOST "https://itwapp.io$URL&signature=$MD5" -H "Content-Type: application/json" --data '
    {
      "mail" : "jerome@itwapp.io",
      "alert" : false,
      "interview" : "53fb562418060018063095dd",
      "lang" : "en",
      "deadline" : 1409045626568  
    }   
'

## OR

URL="/api/v1/applicant/?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "POST:$URL" "$KEY")
curl -XPOST "https://itwapp.io$URL&signature=$MD5" -H "Content-Type: application/json" --data '
    {
      "mail" : "jerome@itwapp.io",
      "alert" : false,
      "question" : [
          {
              "content": "question 1",
              "readingTime": 60,
              "answerTime": 60,
              "number": 1
          }
      ],
      "lang" : "en",
      "deadline" : 1409045626568  
    }   
'
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

$param = [
    "mail" => "jerome@itwapp.io",
    "alert" => false,
    "interview" => "53fb562418060018063095dd",
    "lang" => "en",
    "deadline" => 1409045626568
];
$applicant = Applicant::create($param);

// OR

$param = [
    "mail" => "jerome@itwapp.io",
    "alert" => false,
    "questions" => [
        [
            "content" => "question 1",
            "readingTime"=> 60,
            "answerTime"=> 45,
            "number"=> 1
        ]
    ],
    "lang" => "en",
    "deadline" => 1409045626568
];
$applicant = Applicant::create($param);

Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Map<String, Object> param = new HashMap<String, Object>();
param.put("mail", "jerome@itwapp.io");
param.put("alert", false);
param.put("interview", ApplicantTest.interviewId);
param.put("lang", "en");
param.put("deadline", 1409045626568L);

Applicant applicant = Applicant.create(param);

// OR

Map<String, Object> question = new HashMap<String, Object>();
question.put("content", "question 1");
question.put("readingTime", 60);
question.put("answerTime", 60);
question.put("number", 1);

List<Map<String, Object>> questions = new ArrayList<Map<String, Object>>();
questions.add(question);

Map<String, Object> param = new HashMap<String, Object>();
param.put("mail", "jerome@itwapp.io");
param.put("alert", false);
param.put("questions", questions);
param.put("lang", "en");
param.put("deadline", 1409045626568L);

Applicant applicant = Applicant.create(param);

This endpoint creates an interview. If successful, it returns the new applicant. There are two ways for creating an applicant. You can either specify an interview which the applicant will have to take or send a list of questions directly. If you choose this second option, an interview will be generated automatically using this list of questions and will be associated to the applicant.

If some parameters are missing, you will be returned a BadRequest.

HTTP Request

POST https://itwapp.io/api/v1/applicant/

Body Parameters

Parameter Description
mail String
The applicant's email
lang String
Specify the language of the interview interface. You can choose between fr and en.
alert Boolean
Specify if an email should be sent to the applicant.
deadline Timestamp millisecond
The deadline for the applicant to complete the interview.
interview String
The ID of the interview that the applicant should complete.
questions A list of question. It will be ignored if interview parameters were found
show child parameters
message (Optional) String
The message sent with the invitation email
phone (Optional) String
The applicant’s phone number
firstname (Optional) String
The applicant's first name. If not specified, the applicant will be required to enter it when applying. The applicant can also change it before taking the online interview.
interviewName (Optional) String. It will be ignored if interview parameters are found.
The interview name. If not specified, a name will be generated for the interview.
videoLink (Optional) String
The Youtube video to be embedded
textIntro (Optional) String
The introductory text of the interview
callback (Optional, default: https://itwapp.io) String
The redirection URL at the end of the interview.

Delete a Specific Applicant

DEFINITION

DELETE /v1/applicant/<ID>
<?php
/**
 * This endpoint deletes a specific applicant.
 * @param $id string the ID of the applicant to delete
 * @return bool
 */
Applicant::delete($id);
/**
 * @param applicantId The ID of the applicant to delete
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static void delete(String applicantId)

EXAMPLE REQUEST

URL="/api/v1/applicant/53fb562418060018063095dd?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "DELETE:$URL" "$KEY")
curl -XDELETE "https://itwapp.io$URL&signature=$MD5"
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

Applicant::delete("53fb562418060018063095dd");
Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Applicant.delete("53fb562418060018063095dd");

This endpoint deletes a specific applicant.

HTTP Request

DELETE https://itwapp.io/api/v1/applicant/<ID>

URL Parameters

Parameter Description
ID The ID of the applicant to delete

Interview

The interview object

The interview object JSON is structured as detailed below:

{
    "_id": "53fb562418060018063095db",
    "name": "Interview Test",
    "questions": [],
    "video": "https://www.youtube.com/watch?v=-5K-wmNKavA",
    "text": "Welcome to your video interview test: Interview Test",
    "callback": "https://itwapp.io",
    "sent": 0,
    "answers": 0,
    "new": 0
}
Attributes
_id: String
This is the unique identifier of the interview.
name: String
This is the name of the interview, as displayed to the applicant.
questions: List of Questions
It will be displayed to the applicant in the interview interface only.
video: String
This is the link of the Youtube video chosen as the introduction video. It will be shown to the candidate before the interview starts.
text: String
This is a short description for the interview. It is displayed along with the Youtube video.
callback: String
The redirection URL at the end of the interview.
sent: Int
Number of invitation sent to pass this interview.
answers: Int
Number of applicant that have completed the interview.
new: Int
Number of applicant not yet see.

Get All Interviews

DEFINITION

GET /v1/interview/
<?php
/**
 * This method retrieves all interview. The interviews are returned sorted by creation date, with the most recently created interviews appearing first.
 * @param $param string[]
 * @return Interview[]
 */
Interview::findAll($param);
/**
 * @param param a list of param. Parameter excepted is "next" : This parameter is used to paginate.
 * @return a list of interview
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static Interview[] findAll(Map<String, Object> param) throws UnauthorizedException, InvalidRequestError, ResourceNotFoundException, ServiceException, APIException

EXAMPLE REQUEST

URL="/api/v1/interview/?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "GET:$URL" "$KEY")
curl "https://itwapp.io$URL&signature=$MD5"
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

$interviews = Interview::findAll(array());

// With pagination
$param = [
  "next" => "53fb562418060018063095dd"
];
$interviews2 = Interview::findAll($param);
Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Interview[] res = Interview.findAll(new HashMap<String, Object>());

// With pagination
Map<String, Object> param = new HashMap<String, Object>();
param.put("next", "53fb562418060018063095dd");

Interview[] res = Interview.findAll(param);

This endpoint retrieves all the interviews you created. These interviews will be returned sorted by creation date, the most recently created interview appearing on top of the list.

HTTP Request

GET https://itwapp.io/api/v1/interview/

Query Parameters

Parameter Default Description
next None This ID is used to paginate. It corresponds to the ID of an interview. When this ID is passed to the url, all interviews appearing after this ID in the list will be returned.

Get a Specific Interview

DEFINITION

GET /v1/interview/<ID>
<?php
/**
 * This method retrieves a specific interview.
 * @param $id string
 * @return Interview
 */
Interview::findOne($param);
/**
 * @param interviewId The ID of the interview to retrieve
 * @return the interview
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static Interview findOne(String interviewId) throws UnauthorizedException, InvalidRequestError, ResourceNotFoundException, ServiceException, APIException

EXAMPLE REQUEST

URL="/api/v1/interview/53fb562418060018063095dd?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "GET:$URL" "$KEY")
curl "https://itwapp.io$URL&signature=$MD5"
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

$interview = Interview::findOne("53fb562418060018063095dd");
Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Interview itw = Interview.findOne("53fb562418060018063095dd");

This endpoint retrieves a specific interview.

HTTP Request

GET https://itwapp.io/api/v1/interview/<ID>

URL Parameters

Parameter Description
ID The ID of the interview to retrieve

Get all applicants corresponding to one interview

DEFINITION

GET /v1/interview/<ID>/applicant
<?php
/**
 * @param $id
 * @param $param string[]
 * @return Applicant[]
 */
Interview::findAllApplicant($id, $param);
/**
 * @param interviewId
 * @param param
 * @return
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static Applicant[] findAllApplicant(String interviewId, Map<String, Object> param) throws UnauthorizedException, InvalidRequestError, ResourceNotFoundException, ServiceException, APIException

EXAMPLE REQUEST

URL="/api/v1/interview/<ID>/applicant?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "GET:$URL" "$KEY")
curl "https://itwapp.io$URL&signature=$MD5"
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

$applicants = Interview::findAllApplicant("53fb562418060018063095dd", array());
// With pagination
$param = [
  "next" => "53fb562418060018063095de"
];
$applicants2 = Interview::findAllApplicant("53fb562418060018063095dd", array());
Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Applicant[] applicants = Interview.findAllApplicant("53fb562418060018063095dd", new HashMap<String, Object>());
// With pagination
Map<String, Object> param = new HashMap<String, Object>();
param.put("next", "53fb562418060018063095dd");
Applicant[] applicants = Interview.findAllApplicant("53fb562418060018063095dd", param);

This endpoint retrieves all applicants for a specific interview. Applicants will be returned sorted by creation date, the most recently created appearing on top of the list.

HTTP Request

GET https://itwapp.io/api/v1/interview/<ID>/applicant

Query Parameters

Parameter Default Description
next None This ID is used to paginate. It corresponds to the ID of an applicant. When this ID is passed to the url, all applicants appearing after this ID in the list will be returned.

Create an interview

DEFINITION

POST /v1/interview/
<?php
/**
 * This endpoint create an interview. It return the new interview if success.
 * @param $param string[]
 * @throws InvalidRequestError
 * @return Interview
 */
Interview::create($param);
/**
 * @param param
 * @return the interview just created
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static Interview create(Map<String, Object> param) throws UnauthorizedException, InvalidRequestError, ResourceNotFoundException, ServiceException, APIException

EXAMPLE REQUEST

URL="/api/v1/interview/?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "POST:$URL" "$KEY")
curl -XPOST "https://itwapp.io$URL&signature=$MD5" -H "Content-Type: application/json" --data '
    {
      "name": "interview 1",
      "questions": [
        {
          "content": "question 1",
          "readingTime": 60,
          "answerTime": 60,
          "number": 1
        }
      ],
      "video": "",
      "text": ""   
    }   
'
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

$param = [
    "name" => "interview 1",
    "questions" => [
        [
            "content" => "question 1",
            "readingTime"=> 60,
            "answerTime"=> 60,
            "number"=> 1
        ]
    ],
    "video"=> "",
    "text"=> ""
];

$interview = Interview::create($param);

Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Map<String, Object> param = new HashMap<String, Object>();

param.put("name", "interview 1");
param.put("video", "");
param.put("text", "");

Map<String, Object> question = new HashMap<String, Object>();

question.put("content", "question 1");
question.put("readingTime", 60);
question.put("answerTime", 60);
question.put("number", 1);

List<Map<String, Object>> questions = new ArrayList<Map<String, Object>>();
questions.add(question);

param.put("questions", questions);


Interview interview = Interview.create(param);

This endpoint creates an interview. If successful, it returns the new interview you created.

If some parameters are missing, you will be returned a BadRequest.

HTTP Request

POST https://itwapp.io/api/v1/interview/

Body Parameters

Parameter Description
name String
The name
questions A list of questions
show child param
video String
The Youtube video to be embedded
text String
The short description
callback (Optional, default: https://itwapp.io) String
The redirection URL at the end of the interview.

Update an interview

DEFINITION

PUT /v1/interview/<ID>
<?php
/**
 * This endpoint update an interview. It return the new interview if success. If some parameters is missing it will return a BadRequest.
 * @param $id string the ID of the interview to update
 * @param $param string[]
 * @throws InvalidRequestError
 * @return Interview
 */
Interview::update($id, $param);
/**
 * @param interviewId The ID of the interview to update
 * @param param see param on doc at http://api.itwapp.io/#update-an-interview
 * @return the updated interview
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static Interview update(String interviewId, Map<String, Object> param) throws UnauthorizedException, InvalidRequestError, ResourceNotFoundException, ServiceException, APIException

EXAMPLE REQUEST

URL="/api/v1/interview/<ID>?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "PUT:$URL" "$KEY")
curl -XPUT "https://itwapp.io$URL&signature=$MD5" -H "Content-Type: application/json" --data '

    {
        "name": "interview 1",
        "questions": [
            {
                "content": "question 1 - Updated",
                "readingTime": 60,
                "answerTime": 60,
                "number": 1
            },
            {
                "content": "question 2",
                "readingTime": 60,
                "answerTime": 60,
                "number": 2
            }
        ],
        "video": "",
        "text": ""   
    }  

'
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

$param = [
    "name" => "interview 1",
    "questions" => [
        [
            "content" => "question 1 - Updated",
            "readingTime"=> 60,
            "answerTime"=> 60,
            "number"=> 1
        ],
        [
            "content" => "question 2",
            "readingTime"=> 60,
            "answerTime"=> 60,
            "number"=> 2
        ]
    ],
    "video"=> "",
    "text"=> ""
];

$interview = Interview::update("53fb562418060018063095df", $param);

Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Map<String, Object> param = new HashMap<String, Object>();

param.put("name", "interview 1");
param.put("video", "");
param.put("text", "");

Map<String, Object> question = new HashMap<String, Object>();

question.put("content", "question 1 - Updated");
question.put("readingTime", 60);
question.put("answerTime", 60);
question.put("number", 1);

Map<String, Object> question2 = new HashMap<String, Object>();

question2.put("content", "question 2");
question2.put("readingTime", 60);
question2.put("answerTime", 60);
question2.put("number", 2);

List<Map<String, Object>> questions = new ArrayList<Map<String, Object>>();
questions.add(question);
questions.add(question2);

param.put("questions", questions);

Interview interview = Interview.update("53fb562418060018063095df", param);

This endpoint updates an interview. If successful, it returns the updated interview. If some parameters are missing, you will be returned a BadRequest.

HTTP Request

PUT https://itwapp.io/api/v1/interview/<ID>

URL Parameters

Parameter Description
ID The ID of the interview to update

Body Parameters

Parameter Description
name String
The name
questions A list of questions
show child param
video String
The Youtube video to be embedded
text String
The short description
callback (Optional, default: http://itwapp.io) String
The redirection URL at the end of the interview.

Delete a Specific Interview

DEFINITION

DELETE /v1/interview/<ID>
<?php
/**
 * this endpoint delete a specific interview.
 * @param $id string the ID of the interview to delete
 * @param $param string[]
 * @return void
 */
Interview::delete($id, $param);
/**
 * @param interviewId The ID of the interview to be deleted
 * @param param a list of param. Parameter excepted is "withApplicant" : Boolean default false
 * @throws UnauthorizedException
 * @throws InvalidRequestError
 * @throws ResourceNotFoundException
 * @throws ServiceException
 * @throws APIException
 */
public static void delete(String interviewId, Map<String, Object> param) throws UnauthorizedException, InvalidRequestError, ResourceNotFoundException, ServiceException, APIException

EXAMPLE REQUEST

URL="/api/v1/interview/53fb562418060018063095dd?apiKey=YOUR_KEY_HERE&timestamp=CURRENT_TIMESTAMP_MILLIS"
MD5=$(sign "DELETE:$URL" "$KEY")
curl -XDELETE "https://itwapp.io$URL&signature=$MD5"
<?php
require_once('./lib/Itwapp.php');
Itwapp::setApiKey("627c8047c69c25b7e1db3064b61917e0");
Itwapp::setApiSecretKey("a6e38238874cb44f4efd6bc462853cd8fd39da62");

Interview::delete("53fb562418060018063095dd", array());
// With all applicants
$param = [
    "withApplicant" => true
];
Interview::delete("53fb562418060018063095dd", $param);

Itwapp.apiKey = "627c8047c69c25b7e1db3064b61917e0";
Itwapp.secretKey = "a6e38238874cb44f4efd6bc462853cd8fd39da62";

Interview.delete("53fb562418060018063095dd", new HashMap<String, Object>());
// With all applicants
Map<String, Object> param = new HashMap<String, Object>();
param.put("withApplicant", true);
Interview.delete("53fb562418060018063095dd", param);

This endpoint retrieves a specific interview.

HTTP Request

DELETE https://itwapp.io/api/v1/interview/<ID>

URL Parameters

Parameter Description
ID The ID of the interview to be deleted
withApplicant Boolean default false. This parameter specifies whether all applicants corresponding to this interview must also be deleted or not.

Question

The question object

The interview object JSON is structured as detailed below:

{
  "content": "question 1",
  "readingTime": 60,
  "answerTime": 60,
  "number": 1
}
Attributes
content: String
This is the question.
readingTime: Number
This is the max duration available for the applicant to read the question and prepare the answer. Accepted value are : 60, 120, 180, 240, 300
answerTime: Number
This is the max duration available for the applicant to answer the question. Accepted value are : 60, 120, 180, 240, 300
number: Number
This is the position of the question in the interview.

Response

The response object

The interview object JSON is structured like this:

{
  "file": "https://video-prod-itwapp.s3.amazonaws.com/XXXXX/XXXX.mp4",
  "duration": 60,
  "fileSize": 1048576,
  "number": 1,
  "thumbnail": "https://video-prod-itwapp.s3.amazonaws.com/XXXXX/XXXX-00001.png"
}
Attributes
file: String
This is the url of the video response.
duration: Number
This is the duration of the video response.
fileSize: Number
This is the file size of this video response in byte.
number: Number
This is the position of the video response in the interview.
thumbnail: String
This is the thumbnail url for this video.

Errors

io.itwapp.exception.UnauthorizedException       // 401 | Unauthorized
io.itwapp.exception.InvalidRequestError         // 400 | Bad Request
io.itwapp.exception.ResourceNotFoundException   // 404 | Not Found
io.itwapp.exception.ServiceException            // 500 | Internal Server Error && 503 | Service Unavailable
io.itwapp.exception.APIException                // Other error

The InterviewApp API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request contains missing or wrong parameters.
401 Unauthorized -- Your request isn't properly signed.
404 Not Found -- The specified resource could not be found.
500 Internal Server Error -- We encountered a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.