Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

myinterview

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

myinterview

Build and integrate myInterview with ease via our node.js npm package and connect to the myInterview API.

  • 1.2.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

MyInterview-node

The documentation for the myInterview API can be found here.

Prerequisites

This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.

$ npm -v && node -v
6.13.4
v8.17.0

Install

npm i myinterview

:warning: Do not use this Node.js library in a front-end application. Doing so can expose your myInterview credentials to end-users as part of the bundled HTML/JavaScript sent to their browser.

Usage

Basic configuration

const { MyInterviewApi } = require('myinterview');

MyInterviewApi.setConfig({
  secret: 'yoursecret',
  companyId: 'yourcompanyid',
  accessKey: 'youraccesskey',
});

To use the SDK you have to set the configuration with the keys provided by myinterview prior use of the classes.

Responses (Regular/Error)

Standard Response

FieldTypeDescription
statusCodenumberStatus code of the response
errorCodenumberInternal error code
statusReasonstringInfo message of the response
callIdstringInternal call ID
dataanyThis field contain the data required based on the request
timeDate / numberTimestamp

This is the response object you will receive from the SDK the content of data will change based on your request.

Standard Error Response

FieldTypeDescription
*errorMessagestringError message
errorDetailsstringError message details
*statusCodenumberStatus code of the response
*errorCodenumberInternal error code
*statusReasonstringInfo message of the response
*callIdstringInternal call ID
*timeDate / numberTimestamp
*required field

TestMode

The test mode is not connected to any Database all the call are just checking if the payload or the url are correct if you try to create or update nothing will be saved as all the response are mock data.

Jobs

const { Jobs } = require('myinterview')
Description

The Job Model serves as the starting point for setting up video interviews. It allows you to configure various aspects of the interview, such as questions, link appearance, description, and more.

Note: To invite a candidate for a myInterview video interview, a Job Model must be set up first.

There are several ways to create a Job Model:

  1. Use the createJob API endpoint to create a Job Model with the required information.
  2. Use the createJobWithCandidates API endpoint to create a Job Model along with associated candidate(s) by providing the necessary information in the request.
  3. Obtain a secure, updated URL to access a sleek and user-friendly interface in myInterview by using the getJobUpdateUrl API endpoint, or by adding the option in createJob. This allows for easy updates to your created Job Model. For more details, refer to the documentation below.

Once the Job Model is set up, you can manage and monitor the progress of your video interviews. You can view the status of individual candidates, review completed interviews, and make informed decisions based on the candidates' responses. The Job Model ensures a streamlined and efficient interview process, enabling you to find the best talent for your organization.

Note: When creating a job, there are two ways to invite a candidate:

  1. Explicitly create a candidate and send a personalized invitation.
  2. Obtain the direct link from the response, which can be sent to any candidate without a formal invitation.

getJobs

const res = await Jobs.getJobs();

const jobs = res.data;

getJobsByIds

const ids = ['id1', "id2"]

const res = await Jobs.getJobsByIds(ids);

const jobs = res.data;

getJob

You can obtain the new update URL to access a sleek and user-friendly interface in myInterview, which makes it easy to update your created job. If you add the options object with the flag getUpdateUrl.

Job Service

const id = "job_id"
const options = { getUpdateUrl: true };

const res = await Jobs.getJob(id);

const job = res.data;

createJob

const body = {
  title: "job_title",
  language: 'en',
  overlay: '#000000',
  config: {
    hideQuestions: true,
    practice: true
  },
  jobDescription: 'jobDescription',
  logo: "logo.url.com",
  questions: [{
    numOfRetakes: 1,
    partDuration: 30,
    question: "How are you today?",
    description: "This is a description",
    thinkingTime: 30
  }],
  // fields available: (cvUrl,phoneNumber,document,coverLetter,socialProfile,website,linkedin,address)
  jobInputFields: [
    {
      fieldName: 'cvUrl',
      required: true
    },
    {
      fieldName: 'phoneNumber',
    },
    {
      fieldName: 'additionalFile',
      required: false
    },
    template_id: 'any-template-id',
  ]
}

await Jobs.createJob(body);

createJob Params

FieldTypeDescription
*titlestringTitle of the job
template_idstringIf the template ID is given you will create your job with the template questions
languagestringLanguage of the job
overlaystringOverlay of the of the application page (Value in Color Hexa #000000)
termsUrlstringUrl of the Terms of Service
privacyUrlstringUrl of the Privacy
backgroundImagestringBackground Image of the of the application page
transcriptLanguagestringLanguage of the transcript video
*configConfig ObjectConfiguration object
deadlineDateISO Date stringDeadline date for the job
experiencestringexperience of the job
jobDescriptionstringJob description
logostringLogo
*questionsArray of job questionsArray of job questions objects
skillsArray of stringskills
introVideostringintroduction video for application page
jobInputFieldsarraylist of document that you will ask the candidate for. (Maximum length is 3 elements)
jobInputFields.*.fieldNamestringname of document need to be in the following (cvUrl,phoneNumber,additionalFile,coverLetter,socialProfile,website,linkedin,address)
jobInputFields.*.requiredbooleanflag indicating if the document is required
*required field

Comment: Setting up the AI for a job including its persona qualities is made via “Configure job's candidates qualities“ endpoint. You can find it under jobs section.

createJobWithCandidates

This call will create for you the job, candidate and will send an invite email to the candidate.

const body = {
  template_id: 'template_id', // If provided the questions will be taken from template
  title: "job_title",
  language: 'en',
  overlay: '#000000',
  config: {
    practice: true
  },
  jobDescription: 'jobDescription',
  logo: "logo.url.com",
  questions: [{
    numOfRetakes: 1,
    partDuration: 30,
    question: "How are you today?",
    description: "This is a description",
    thinkingTime: 30
  }],
  // fields available: (cvUrl,phoneNumber,document,coverLetter,socialProfile,website,linkedin,address)
  jobInputFields: [
    {
      fieldName: 'cvUrl',
      required: true
    },
    {
      fieldName: 'phoneNumber',
    },
    {
      fieldName: 'additionalFile',
      required: false
    },
  ],
  candidates: {
    communication: true,
    reminders: true,
    deadlineDate: "2021-10-20T08:42:59.537+00:00",
    timezoneForInvite: "Australia/Sydney",
    candidates: [{
      username: "username",
      email: "email@email.com",
    }]
  }
}

await Jobs.createJobWithCandidates(body);

createJobWithCandidates Params

FieldTypeDescription
template_idstringIf the template ID is given you will create your job with the template questions
*titlestringTitle of the job
questionsArray of job questionsArray of job questions objects is required if you don't provide template_id
languagestringLanguage of the job
overlaystringOverlay of the of the application page (Value in Color Hexa #000000)
termsUrlstringUrl of the Terms of Service
privacyUrlstringUrl of the Privacy
backgroundImagestringBackground Image of the of the application page
transcriptLanguagestringLanguage of the transcript video
configConfig ObjectConfiguration object
deadlineDateISO Date stringDeadline date for the job
experiencestringexperience of the job
jobDescriptionstringJob description
logostringLogo
skillsArray of stringskills
introVideostringintroduction video for application page
jobInputFieldsarraylist of document that you will ask the candidate for. (Maximum length is 3 elements)
jobInputFields.*.fieldNamestringname of document need to be in the following (cvUrl,phoneNumber,additionalFile,coverLetter,socialProfile,website,linkedin,address)
jobInputFields.*.requiredbooleanflag indicating if the document is required
*required field

Comment: Setting up the AI for a job including its persona qualities is made via “Configure job's candidates qualities“ endpoint. You can find it under jobs section.

updateJob

const body = {
  job_id: 'job_id',
  title: "job_title",
  language: 'en',
  overlay: '#000000',
  config: {
    hideQuestions: true,
    practice: true
  },
  jobDescription: 'jobDescription',
  logo: "logo.url.com",
  questions: [{
    numOfRetakes: 1,
    partDuration: 30,
    question: "How are you today?",
    description: "This is a description",
    thinkingTime: 30
  }],
  // fields available: (cvUrl,phoneNumber,document,coverLetter,socialProfile,website,linkedin,address)
  jobInputFields: [
    {
      fieldName: 'cvUrl',
      required: true
    },
    {
      fieldName: 'phoneNumber',
    },
    {
      fieldName: 'additionalFile',
      required: false
    },
  ],
}

await Jobs.updateJob(body);

updateJob Params

FieldTypeDescription
*job_idstringID of the job
template_idstringIf the template ID is given you will update your job with the template questions
titlestringTitle of the job
languagestringLanguage of the job
overlaystringOverlay of the of the application page (Value in Color Hexa #000000)
termsUrlstringUrl of the Terms of Service
privacyUrlstringUrl of the Privacy
backgroundImagestringBackground Image of the of the application page
transcriptLanguagestringLanguage of the transcript video
configConfig ObjectConfiguration object
deadlineDateISO Date stringDeadline date for the job
experiencestringexperience of the job
jobDescriptionstringJob description
logostringLogo
questionsArray of job questionsArray of job questions objects
skillsArray of stringskills
introVideostringintroduction video for application page
jobInputFieldsarraylist of document that you will ask the candidate for. (Maximum length is 3 elements)
jobInputFields.*.fieldNamestringname of document need to be in the following (cvUrl,phoneNumber,additionalFile,coverLetter,socialProfile,website,linkedin,address)
jobInputFields.*.requiredbooleanflag indicating if the document is required
*required field

updateJobIntelligence

Create/Edit the top 5 qualities in the ideal candidate. candidates will be scored according to that.

const body = {
  job_id: 'job_id',
  intelligence: [
    {
      name: 'Creative',
      order: 1,
    },
    {
      name: 'Persuasive',
      order: 2,
    },
    {
      name: 'Assertive',
      order: 3,
    },
    {
      name: 'Optimistic',
      order: 4,
    },
    {
      name: 'Outgoing',
      order: 5,
    },
  ],
};

const res = await Jobs.updateJobIntelligence(body);

updateJobIntelligence Params

FieldTypeDescription
*job_idstringjob_id
*intelligence.ordernumberorder from 1 to 5
*intelligence.namestringtrait name needs to be one of the following values: Creative, Strategic, Disciplined, Driven, Friendly, Outgoing, Assertive, Persuasive, Stress Tolerant, Optimistic
*required field

getJobUpdateUrl

You can obtain the new update URL to access a sleek and user-friendly interface in myInterview, which makes it easy to update your created job.

Job Service

const id = "job_id"

const res = await Jobs.getJobUpdateUrl(id);

const url = res.data.url;

Candidates

const { Candidates } = require('myinterview');
Description

The Candidate Model is designed to facilitate inviting a candidate for a job interview. It stores all necessary information for generating an invitation and must be linked to a pre-existing job. This information is used to invite the candidate and generate a personalized myInterview video interview link.

Within the Candidate Model, there is a status field that indicates the current state of the invitation.

Note: The Candidate Model itself is not the video; the video refers to the actual video interview that can be played back.

Upon the Candidate Model's status changing to "completed," a video_id will be assigned to both the Candidate Model and the associated video. This identifier can be utilized to access the video interview for playback.

getCandidate

Get candidate details by id.

const res =  await Candidates.getCandidate('candidate_id');

const candidate = res.data;

getJobCandidates

Lists all candidates of a job including their created date, their invite status and personal details like name and email.

const body = {
  job_id: "job_id",
  query: {
    ids: ['candidate_id1', 'candidate_id2'],
    email: 'email@email.com',
    status: 'pending',
    username: 'username',
    skip: 0,
    limit: 20,
  }
};

const res = await Candidates.getJobCandidates(body);

const candidates = res.data;

getJobCandidates Params

FieldTypeDescription
*job_idstringID of the job
query.idsstring arrayids of candidates you need
query.emailstringemail of candidate you need
query.statusstringstatus of the candidate enum (pending, clicked, completed, cancelled)
query.usernamestringusername of candidate you need
query.skipnumberPagination
query.limitnumberPagination
*required field

createBulkCandidates

Create one or more candidates.

const body = {
  job_id: "job_id",
  communication: true,
  reminders: true,
  deadlineDate: "2021-10-20T08:42:59.537+00:00",
  timezoneForInvite: "Australia/Sydney",
  candidates: [{
    username: "username", 
    email: "email@email.com",
    jobTitle: "Job title",
  }]
};

await Candidates.createBulkCandidates(body);

createBulkCandidates Params

FieldTypeDescription
*job_idstringID of the job to connect the candidate
communicationbooleanFlag to send mail to invited candidates (default = false)
remindersbooleanFlag to activate reminders mails
deadlineDateISO Date stringDeadline date for the candidate/s
timezoneForInvitestringTimezone for the deadline
*candidatesArray of candidate objectArray of candidate objects
*required field

This call will create one or more candidates and connect them to your Job.

updateCandidate

Update candidates details, deadline change is optional.

const body = {
  id: "candidate_id", // You have to provide the id of the candidate
  username: "username",
  email: "email@email.com",
  jobTitle: "Job title",
};

await Candidates.updateCandidate(body);

updateCandidate Params

FieldTypeDescription
*idstringID of the candidate
statusstringStatus of the candidate
usernamestringUsername of the candidate
deadlineISO Date stringDeadline date for the candidate/s
timezoneForInvitestringTimezone for the deadline
*required field

deleteBulkCandidates

Delete candidates bulk by ids.

const body = {
  candidateIds: ["candidate_id", "candidate_id1", "candidate_id2"]// You have to provide the id of the candidate
};

await Candidates.deleteBulkCandidates(body);

deleteBulkCandidates Params

FieldTypeDescription
*candidateIdsstring arrayIDs of the candidates

*required field

Companies

const { Companies } = require('myinterview')
Description

The Company Model consolidates all information about your company, making it an excellent starting point for retrieving your company's details in JSON format using the getCompanyInfo API endpoint.

Additionally, you can set up templates to avoid rewriting questions repeatedly. Simply use the template_id when creating a job. For an example, refer to the Job Model section.

Note: You can also configure templates within the myInterview dashboard and reuse them by calling the getCompanyTemplates API endpoint.

getCompanyInfo

const res = await Companies.getCompanyInfo();

const companyInfo = res.data;

getCompanyTemplates

Returns an array of job questionnaire templates.

const res = await Companies.getCompanyTemplates();

const templates = res.data;

createCompanyTemplateBulk

Create job questionnaire templates. These questions will be displayed to the candidates when they apply during the video recording session.

const body = [{
  id: "template_id",
  name: "template_name",
  questions: [{
    numOfRetakes: 1,
    partDuration: 30,
    question: "How are you today?"
  }],
  introVideo: 'youtube.com/watch'
  },
  {
  id: "template_id",
  name: "template_name",
  questions: [{
    numOfRetakes: 1,
    partDuration: 30,
    question: "How are you today?",
    description: "This is a description",
    thinkingTime: 30
  }],
  introVideo: 'youtube.com/watch'
}]

await Companies.createCompanyTemplateBulk(body);

createCompanyTemplateBulk Params

FieldTypeDescription
*idstringID of the company template
hideQuestionsbooleanquestions will not be displayed upfront
*namestringName of the template
introVideostringUrl of the introduction video on the application page
*questionsArray of job questionsArray of job questions objects
*required field

updateCompanyTemplate

const body = {
  id: "template_id",
  name: "template_name",
  questions: [{
    numOfRetakes: 1,
    partDuration: 30,
    question: "How are you today?",
    description: "This is a description",
    thinkingTime: 30
  }],
  introVideo: 'youtube.com/watch'
  };

await Companies.updateCompanyTemplate(body);

updateCompanyTemplate Params

FieldTypeDescription
*idstringID of the company template
hideQuestionsbooleanquestions will not be displayed upfront
namestringName of the template
introVideostringUrl of the introduction video on the application page
*questionsArray of job questionsArray of job questions objects
*required field

Videos

const { Videos } = require('myinterview')
Description

The Video Model represents the final stage of the typical workflow when a candidate has completed their video recording.

Note: To remove a video from your job kanban, you must delete the video, not the candidate, using the deleteBulkVideos API endpoint.

There are two options to view the video:

  1. Use the API to obtain the video in JSON format, which includes signed URLs for all video questions.
  2. Obtain a sleek share link that can be opened anywhere by calling the getShareLink API endpoint.

getVideo

Get the video information including the video playable url and transcript and AI results. (according to your subscription)

const body = {
    video_id: 'video_id',
    ai: true,
    transcript: true
}

const res = await Videos.getVideo(body);

const video = res.data;

getVideoParams

FieldTypeDescription
*video_idstringID of the Video
aibooleanadd ai object to the video object
transcriptbooleanadd transcript object to the video object
*required field

getVideos

Get all videos, including the video playable url and transcript and AI results. (according to your subscription)

const body = {
    ai: true,
    transcript: true,
    username: 'fullname',
    email: "email@example.com",
    skip: 0,
    limit: 20
}

const res = await Videos.getVideos(body);

const videos = res.data;

getVideosParams

FieldTypeDescription
aibooleanadd ai object to the video object
transcriptbooleanadd transcript object to the video object
usernamestringget with specific username
emailstringget with specific email
skipnumberfor pagination
limitnumberfor pagination
*required field

getJobVideos

Get the videos of the candidates who applied to a job.

const body = {
  job_id: 'job_id',
  query: { // Optional
    email: "email@example.com",
    username: "fullname",
    candidate_id: "candidate_id",
    skip: 20,
    limit: 20
  }
}

const res = await Videos.getJobVideos(body);

const videos = res.data;

getJobVideos Params

FieldTypeDescription
*job_idstringID of the job
queryQuery ObjectQuery object
*required field

Get the candidate/video recording share url. With this video url you can watch and review the application on myinterview share page without login.

const id = "video_id"

const res = await Videos.getShareLink(id);

const shareLink = res.data.shareLink;

deleteBulkVideos

Delete videos bulk by ids.

const body = {
  videoIds: ["video_id", "video_id1", "video_id2"]// You have to provide the id of the candidate
};

await Candidates.deleteBulkVideos(body);

deleteBulkVideos Params

FieldTypeDescription
*videoIdsstring arrayIDs of the videos

*required field

Shares

const { Shares } = require('myinterview');
Description

The Share Model provides a method for generating a personalized URL containing the video_id(s) you want to share with others. For example, if you have several video candidates you'd like to share with a colleague or another party, you can use the getShortlistUrl API endpoint to obtain a URL featuring the selected videos and comments on the candidates.

This feature makes it easy to collaborate with team members, hiring managers, or other stakeholders involved in the recruitment process. By sharing a single URL, you can provide access to specific candidate videos, enabling efficient evaluation and discussion. The Share Model simplifies the process of sharing candidate information and streamlines decision-making, helping your organization identify the best talent.

getShortlistUrl

Create shortlist of selected candidates and share it with your teammates.

  • recipients email is optional
const body = {
  candidate_videos: [
    {
      id: 'video_id',
    },
  ],
  job_id: 'job_id',
  anonymised: true,
  share_personality: true,
  recipients: [
    {
      recipient_email: 'mail@myinterview.com',
      recipient_name: 'Harry Potter',
    },
  ],
};

const res = await Shares.getShortlistUrl(body);

const shortlistUrl = res.data.shortlistUrl;

getShortlistUrl Params

FieldTypeDescription
*candidate_videosArray of ObjectIds of the videos you want to share
*job_idstringID of the job
anonymisedbooleanFlag to anonymised the candidates name
share_personalitybooleanFlag to add AI Insights
recipientsArray of ObjectArray of recipients (recruiters) if you add some they will receive a mail with the link to comment the videos
*required field

Webhooks

const { Webhooks } = require('myinterview');
Description

You can configure a webhook to receive notifications each time one of your candidates completes a video interview. To set up a webhook, provide a URL where a POST request will be sent with the following payload (example data):

{
  "videoID": "599bfd33-9f46-478d-be96-0490d59b2cbc",
  "candidate_email": "candidate_email@test.com",
  "candidate_name": "Candidate's Name",
  "interview_URL": "https://share.myinterview.com/video/EMySrUICZPlVFYlR2ry4UKZxEDirhK53t923",
  "interview_date": "2021-10-28T09:42:22.959Z",
  "candidateID": "369b0d23-9f46-408d-be96-0490d8kds63gw",
  "jobID": "k99b0po0-2w46-4pdd-b106-049338kds9ojdw",
  "jobTitle": "Webhook Job Test"
}

By implementing a webhook, you can automate the process of receiving updates about candidate video completions, making it easier to track and manage your recruitment process. This helps you stay informed of candidates' progress in real-time, enabling you to take timely actions, such as evaluating their interviews or moving them to the next stage of the hiring process. The webhook also allows for seamless integration with your existing recruitment tools and platforms, streamlining your workflow and improving overall efficiency.

testWebhook

const body = {
  url: 'https://webhook.test',
}

const res = await Webhooks.testWebhook(body);

testWebhook Params

FieldTypeDescription
*urlstringwebhook url
*required field

createWebhook

const body = {
  url: 'https://webhook.io',
}

const res = await Webhooks.createWebhook(body);

createWebhook Params

FieldTypeDescription
*urlstringwebhook url
*required field

TimezoneForInvite

You can get the list of timezones on this link

Error Handling

You can catch the error the same way you catch error normally.

Async/Await
try {
  const res = await Videos.getVideoPersonality("");
} catch (error) {
  // The error will be of type IApiErrorObj the definition is above.
  console.log(error)
}
Callback
Videos.getVideoPersonality("").then((res) => {
    // Type IApiResponseObj 
}).catch((error) => {
    // The error will be of type IApiErrorObj the definition is above.
    console.log(error)
})

Authentication Helper for API

populateHeaders

This call will populate the headers you need to connect to the global API service it will return an object that you can use in you request. In order to authenticate to the API you need to populate the headers (x-myinterview-timestamp, x-myinterview-key, x-myinterview-signed) the populateHeaders method will return an object that you need to include in the headers config.

import { MyInterviewApi } from 'myinterview';

MyInterviewApi.populateHeaders({
  secret: 'yoursecret',
  companyId: 'yourcompanyid',
  accessKey: 'youraccesskey',
});

It will return:

{
    'x-myinterview-timestamp': 'headTimestamp', 
    'x-myinterview-key': 'headKey',
    'x-myinterview-signed': 'headSigned'
}

Authors

  • dvd90 (David Sellam)

Keywords

FAQs

Package last updated on 12 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc