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

myinterview

Package Overview
Dependencies
Maintainers
4
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.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
114
decreased by-6.56%
Maintainers
4
Weekly downloads
 
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.

Candidates

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

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')

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

Jobs

const { Jobs } = require('myinterview')

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;

Videos

const { Videos } = require('myinterview')

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');

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');

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

  • Dvd1109 (David Sellam)

Keywords

FAQs

Package last updated on 28 Feb 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