@ivueit/iv3client v1.0.13
IvueIt Node API Client
Install
npm install @ivueit/iv3client
Usage
const IvueIt = require('iv3client');
const api = new IvueIt('host', 'apiKey', 'secret');
const api.authorize();
Once you successfully authorize, you are able to use the exposed methods.
API
IvueIt(host, apiKey, secret)
- host string of host url, excluding the port
- apikey API Key provided
- secret Secret provided
- token set on authorize()
- client grpc IVueIt service
- loginClient grpc Login service
Authorize()
Sets token in IvueIt class
GetVuesWithinRange(startTime, endTime, pageNumber, pageSize)
Get's a list of vues within a date range. Includes metadata for paging.
- startTime unix timestamp
- endTime unix timestamp
- pageNumer integer
- pageSize integer
Version 1.0.5 now includes new properties submissionId
, pdfUrl
, timeZone
, batchId
Response in typescript interfaces:
export interface Root {
vues: Vue[]
meta: Meta
}
export interface Vue {
metadata: Metadata
canonicalId: string
typeOf: string
title: string
description: string
notes: string
pdfFileId: string
escalated: boolean
escalationNotes: string
postalAddress: string
geolocation: Geolocation
completedAt: string
id: string
submissionId: string
pdfUrl: string
timeZone: string
batchId: string
}
export interface Metadata {
Custom1: string
Custom2: string
}
export interface Geolocation {
latitude: number
longitude: number
}
export interface Meta {
pageSize: string
pageNumber: string
totalPages: string
totalElements: string
}
}
GetFileDownloadUrl(pdfFileId)
Gets a signed url to download a file. Use the pdfFileId
from the GetVuesWithinRange
response to get a signed url for download.
- pdfFileId uuid string
export interface Root {
url: string
}
}
GetSurveyBySubmissionId(submissionId)
Gets the related survey info. Use the submissionId
from the GetVuesWithinRange
response to get all related survey and photo data.
- submissionId uuid string
Improved surveys include new question types listed below. There are also new properties groupId
and groupInstanceId
which will give you the specific question group and the order which it was in.
export interface Root {
steps: Step[]
name: string
}
export interface Step {
photos: Photo[]
stepType: SurveyStepType
description: string
value: string
signatureUrl: string
signatureId: string
groupId: string
groupInstanceIndex: number
options: string
}
export enum SurveyStepType {
PHOTO: 0,
TEXT: 1,
BOOL: 2,
CHECKBOX: 3,
RADIO: 4,
MAPCANVAS: 5,
SIGNATURE: 6,
SELECT: 7,
MULTISELECT: 8,
INSTRUCTIONS: 9,
SLIDER: 10
}
export interface Photo {
info: Info
url: string
}
export interface Info {
id: string
mimeType: string
fileSize: string
capturedAt: string
escalated: boolean
escalationNotes: string
address: string
location: Location
}
export interface Location {
latitude: number
longitude: number
}
}