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

@myinterview/global-api-sdk

Package Overview
Dependencies
Maintainers
5
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@myinterview/global-api-sdk

SDK to access myInterview Global API

  • 1.0.435
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
5
Weekly downloads
 
Created
Source

myInterview - GlobalAPI SDK

You can see the full typed documentation 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.4.1
v8.16.0

Install

npm i @myinterview/global-api-sdk

Usage

Basic configuration

import { GlobalApi } from '@myinterview/global-api-sdk';

GlobalApi.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.

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.

import { GlobalApi } from '@myinterview/global-api-sdk';

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

It will return:

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

Responses (Regular/Error)

Standard Response
interface IApiResponseObj<T = any> {
  statusCode: number;
  errorCode: number;
  statusReason: string;
  callId: string;
  data?: T;
  time: Date | number;
}

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

Standard Error Response
interface IApiErrorObj {
  errorMessage: string | ValidationError[];
  errorDetails?: string;
  statusCode: number;
  errorCode: number;
  statusReason: string;
  callId?: string;
  time: Date | number;
}

This is the error response object you will receive from the SDK.

GACandidates

import { GACandidates } from '@myinterview/global-api-sdk';

createBulkCandidates

interface IBody {
  job_id?: string;
  communication?: boolean;
  deadlineDate?: Date | string | number;
  timezoneForInvite?: string;
  candidates: {
    username?: string;
    email: string;
    phone?: string;
    status?: string;
    reminders?: {
      Content: string;
      companyName: string;
      greetings?: string;
      isSent: boolean;
      reminderDate: Date | string;
      timezone: string;
    }[];
    type?: string;
    candidate_id?: string;
    apiKey?: string;
    jobTitle?: string;
    urlStart?: string;
  }[];
};

await GACandidates.createBulkCandidates(body);

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

updateCandidate

interface IBody {
  id: string; // You have to provide the id of the candidate
  status?: string;
  username?: string;
  deadline?: string | Date | number;
  timezoneForInvite?: string;
  location?: string;
};

await GACandidates.updateCandidate(body);

GACompanies

import { GACompanies } from '@myinterview/global-api-sdk';

getCompanyInfo

const res: IApiResponseObj<ICompany> = await GACompanies.getCompanyInfo();

const companyInfo = res.data;

getCompanyTemplates

const res: IApiResponseObj<ITemplate[]> = await GACompanies.getCompanyTemplates();

const templates = res.data;

createCompanyTemplateBulk

interface IBody {
  id?: string | number;
  hideQuestions?: boolean;
  name: string;
  questions: {
    numOfRetakes: number;
    partDuration: number;
    question: string;
    timeLimit?: number;
    videoQuestion?: string;
  }[];
  intoductionURL?: string;
}[]

await GACompanies.createCompanyTemplateBulk(body);

GAJobs

import { GAJobs } from '@myinterview/global-api-sdk';

getCompanyInfo

const res: IApiResponseObj<IJob[]> = await GAJobs.getJobs();

const jobs = res.data;

getJobsWithIds

const ids: string[];

const res: IApiResponseObj<IJob[]> = await GAJobs.getJobsWithIds(ids);

const jobs = res.data;

getJob

const id: string;

const res: IApiResponseObj<IJob> = await GAJobs.getJob(id);

const job = res.data;

createJob

interface IBody {
  title: string;
  language?: string;
  overlay?: string;
  termsUrl?: string;
  privacyUrl?: string;
  backgroundImage?: string;
  transcriptLanguage?: string;
  config?: IJobConfig;
  deadlineDate?: string | Date | number;
  experience?: string;
  jobDescription?: string;
  logo?: string;
  url?: string;
  questions?: IQuestion[];
  reminderValues?: string[];
  skills?: string[];
  introVideo?: string;
}

await GAJobs.createJob(body);

updateJob

interface IBody {
  job_id: string; // REQUIRED !
  language?: string;
  overlay?: string;
  termsUrl?: string;
  privacyUrl?: string;
  backgroundImage?: string;
  transcriptLanguage?: string;
  title?: string;
  slug?: string;
  config?: IJobConfig;
  deadlineDate?: string | Date | number;
  experience?: string;
  jobDescription?: string;
  logo?: string;
  url?: string;
  questions?: IQuestion[];
  reminderValues?: string[];
  skills?: string[];
  kanban?: IJobKanban[];
  permissions?: IJobPermission[];
  introVideo?: string;
  archived?: boolean;
  api_created?: string;
  location?: string;
}

await GAJobs.updateJob(body);

GAVideos

import { GAVideos } from '@myinterview/global-api-sdk';

getVideo

const id: string;

const res: IApiResponseObj<IVideo> = await GAVideos.getVideo(id);

const video = res.data;

getVideoPersonality

const id: string;

const res: IApiResponseObj<IPersonality> = await GAVideos.getVideoPersonality(id);

const personality = res.data;

Authors

  • Dvd1109

FAQs

Package last updated on 21 Oct 2021

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