Trendsic Platform Service

<back to all web services

InspectionSignRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/inspections/{InspectionUID}/sign
"use strict";
export class InspectionPhoto {
    /** @param {{AttachmentId?:string,FileName?:string,Url?:string,CreatedBy?:string,CreatedDate?:string,HasAnnotation?:boolean,AnnotatedAttachmentId?:string,AnnotatedUrl?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    AttachmentId;
    /** @type {string} */
    FileName;
    /** @type {string} */
    Url;
    /** @type {string} */
    CreatedBy;
    /** @type {?string} */
    CreatedDate;
    /** @type {boolean} */
    HasAnnotation;
    /** @type {?string} */
    AnnotatedAttachmentId;
    /** @type {string} */
    AnnotatedUrl;
}
export class InspectionItem {
    /** @param {{InspectionItemID?:number,InspectionID?:number,Seq?:number,Section?:string,Prompt?:string,ResponseType?:string,IsRequired?:boolean,Unit?:string,Guidance?:string,Result?:string,Value?:string,Notes?:string,PhotoCount?:number,LinkedPunchItemID?:number,LinkedPunchNo?:string,LinkedPunchStatus?:string,LinkedNcrID?:number,LinkedNcrNo?:string,LinkedActionID?:number,AnsweredBy?:string,AnsweredAt?:string,Photos?:InspectionPhoto[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    InspectionItemID;
    /** @type {number} */
    InspectionID;
    /** @type {number} */
    Seq;
    /** @type {string} */
    Section;
    /** @type {string} */
    Prompt;
    /** @type {string} */
    ResponseType;
    /** @type {boolean} */
    IsRequired;
    /** @type {string} */
    Unit;
    /** @type {string} */
    Guidance;
    /** @type {string} */
    Result;
    /** @type {string} */
    Value;
    /** @type {string} */
    Notes;
    /** @type {number} */
    PhotoCount;
    /** @type {?number} */
    LinkedPunchItemID;
    /** @type {string} */
    LinkedPunchNo;
    /** @type {string} */
    LinkedPunchStatus;
    /** @type {?number} */
    LinkedNcrID;
    /** @type {string} */
    LinkedNcrNo;
    /** @type {?number} */
    LinkedActionID;
    /** @type {string} */
    AnsweredBy;
    /** @type {?string} */
    AnsweredAt;
    /** @type {InspectionPhoto[]} */
    Photos = [];
}
export class InspectionRequest {
    /** @param {{InspectionRequestID?:number,InspectionID?:number,Agency?:string,ContactName?:string,ContactPhone?:string,PermitNo?:string,RequestedDate?:string,RequestedWindow?:string,Status?:string,ConfirmationNo?:string,Outcome?:string,CreatedBy?:string,CreatedAt?:string,UpdatedAt?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    InspectionRequestID;
    /** @type {number} */
    InspectionID;
    /** @type {string} */
    Agency;
    /** @type {string} */
    ContactName;
    /** @type {string} */
    ContactPhone;
    /** @type {string} */
    PermitNo;
    /** @type {?string} */
    RequestedDate;
    /** @type {string} */
    RequestedWindow;
    /** @type {string} */
    Status;
    /** @type {string} */
    ConfirmationNo;
    /** @type {string} */
    Outcome;
    /** @type {string} */
    CreatedBy;
    /** @type {?string} */
    CreatedAt;
    /** @type {?string} */
    UpdatedAt;
}
export class SignatureRecord {
    /** @param {{SignatureRecordID?:number,EntityType?:string,EntityID?:number,Role?:string,SignerName?:string,SignerContactID?:number,SignerUserId?:string,Method?:string,ImageAttachmentId?:string,ImageUrl?:string,ImageHash?:string,DocumentHash?:string,ConsentText?:string,IpAddress?:string,UserAgent?:string,SignedAt?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    SignatureRecordID;
    /** @type {string} */
    EntityType;
    /** @type {number} */
    EntityID;
    /** @type {string} */
    Role;
    /** @type {string} */
    SignerName;
    /** @type {?number} */
    SignerContactID;
    /** @type {string} */
    SignerUserId;
    /** @type {string} */
    Method;
    /** @type {?string} */
    ImageAttachmentId;
    /** @type {string} */
    ImageUrl;
    /** @type {string} */
    ImageHash;
    /** @type {string} */
    DocumentHash;
    /** @type {string} */
    ConsentText;
    /** @type {string} */
    IpAddress;
    /** @type {string} */
    UserAgent;
    /** @type {?string} */
    SignedAt;
}
export class Inspection {
    /** @param {{InspectionID?:number,InspectionUID?:string,ProjectID?:number,ProjectName?:string,JobID?:number,JobName?:string,InspectionNo?:string,Type?:string,Title?:string,Status?:string,TemplateUID?:string,TemplateVersionNo?:number,ScheduledFor?:string,StartedAt?:string,CompletedAt?:string,ClosedAt?:string,InspectorContactID?:number,InspectorName?:string,AgencyName?:string,PermitNo?:string,LocationText?:string,Notes?:string,WeatherJson?:string,ItemsTotal?:number,ItemsPassed?:number,ItemsFailed?:number,Outcome?:string,OutcomeNotes?:string,ReinspectionOfInspectionID?:number,QcHoldPointID?:number,ReportAttachmentId?:string,RequestCount?:number,SignatureCount?:number,CreatedBy?:string,CreatedAt?:string,UpdatedAt?:string,Items?:InspectionItem[],Requests?:InspectionRequest[],Signatures?:SignatureRecord[],Actions?:string[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    InspectionID;
    /** @type {string} */
    InspectionUID;
    /** @type {number} */
    ProjectID;
    /** @type {string} */
    ProjectName;
    /** @type {?number} */
    JobID;
    /** @type {string} */
    JobName;
    /** @type {string} */
    InspectionNo;
    /** @type {string} */
    Type;
    /** @type {string} */
    Title;
    /** @type {string} */
    Status;
    /** @type {?string} */
    TemplateUID;
    /** @type {?number} */
    TemplateVersionNo;
    /** @type {?string} */
    ScheduledFor;
    /** @type {?string} */
    StartedAt;
    /** @type {?string} */
    CompletedAt;
    /** @type {?string} */
    ClosedAt;
    /** @type {?number} */
    InspectorContactID;
    /** @type {string} */
    InspectorName;
    /** @type {string} */
    AgencyName;
    /** @type {string} */
    PermitNo;
    /** @type {string} */
    LocationText;
    /** @type {string} */
    Notes;
    /** @type {string} */
    WeatherJson;
    /** @type {number} */
    ItemsTotal;
    /** @type {number} */
    ItemsPassed;
    /** @type {number} */
    ItemsFailed;
    /** @type {string} */
    Outcome;
    /** @type {string} */
    OutcomeNotes;
    /** @type {?number} */
    ReinspectionOfInspectionID;
    /** @type {?number} */
    QcHoldPointID;
    /** @type {?string} */
    ReportAttachmentId;
    /** @type {number} */
    RequestCount;
    /** @type {number} */
    SignatureCount;
    /** @type {string} */
    CreatedBy;
    /** @type {?string} */
    CreatedAt;
    /** @type {?string} */
    UpdatedAt;
    /** @type {InspectionItem[]} */
    Items = [];
    /** @type {InspectionRequest[]} */
    Requests = [];
    /** @type {SignatureRecord[]} */
    Signatures = [];
    /** @type {string[]} */
    Actions = [];
}
export class InspectionResponse {
    /** @param {{ResponseStatus?:ResponseStatus,Inspection?:Inspection}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {ResponseStatus} */
    ResponseStatus;
    /** @type {Inspection} */
    Inspection;
}
export class InspectionSignRequest {
    /** @param {{InspectionUID?:string,Role?:string,SignerName?:string,SignerContactID?:number,Method?:string,ImageDataUrl?:string,ConsentAccepted?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    InspectionUID;
    /** @type {string} */
    Role;
    /** @type {string} */
    SignerName;
    /** @type {?number} */
    SignerContactID;
    /** @type {string} */
    Method;
    /** @type {string} */
    ImageDataUrl;
    /** @type {boolean} */
    ConsentAccepted;
}

JavaScript InspectionSignRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/inspections/{InspectionUID}/sign HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	InspectionUID: 00000000000000000000000000000000,
	Role: String,
	SignerName: String,
	SignerContactID: 0,
	Method: String,
	ImageDataUrl: String,
	ConsentAccepted: False
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Inspection: 
	{
		InspectionID: 0,
		InspectionUID: 00000000000000000000000000000000,
		ProjectID: 0,
		ProjectName: String,
		JobID: 0,
		JobName: String,
		InspectionNo: String,
		Type: String,
		Title: String,
		Status: String,
		TemplateUID: 00000000000000000000000000000000,
		TemplateVersionNo: 0,
		ScheduledFor: 0001-01-01,
		StartedAt: 0001-01-01,
		CompletedAt: 0001-01-01,
		ClosedAt: 0001-01-01,
		InspectorContactID: 0,
		InspectorName: String,
		AgencyName: String,
		PermitNo: String,
		LocationText: String,
		Notes: String,
		WeatherJson: String,
		ItemsTotal: 0,
		ItemsPassed: 0,
		ItemsFailed: 0,
		Outcome: String,
		OutcomeNotes: String,
		ReinspectionOfInspectionID: 0,
		QcHoldPointID: 0,
		ReportAttachmentId: 00000000000000000000000000000000,
		RequestCount: 0,
		SignatureCount: 0,
		CreatedBy: String,
		CreatedAt: 0001-01-01,
		UpdatedAt: 0001-01-01,
		Items: 
		[
			{
				InspectionItemID: 0,
				InspectionID: 0,
				Seq: 0,
				Section: String,
				Prompt: String,
				ResponseType: String,
				IsRequired: False,
				Unit: String,
				Guidance: String,
				Result: String,
				Value: String,
				Notes: String,
				PhotoCount: 0,
				LinkedPunchItemID: 0,
				LinkedPunchNo: String,
				LinkedPunchStatus: String,
				LinkedNcrID: 0,
				LinkedNcrNo: String,
				LinkedActionID: 0,
				AnsweredBy: String,
				AnsweredAt: 0001-01-01,
				Photos: 
				[
					{
						AttachmentId: 00000000000000000000000000000000,
						FileName: String,
						Url: String,
						CreatedBy: String,
						CreatedDate: 0001-01-01,
						HasAnnotation: False,
						AnnotatedAttachmentId: 00000000000000000000000000000000,
						AnnotatedUrl: String
					}
				]
			}
		],
		Requests: 
		[
			{
				InspectionRequestID: 0,
				InspectionID: 0,
				Agency: String,
				ContactName: String,
				ContactPhone: String,
				PermitNo: String,
				RequestedDate: 0001-01-01,
				RequestedWindow: String,
				Status: String,
				ConfirmationNo: String,
				Outcome: String,
				CreatedBy: String,
				CreatedAt: 0001-01-01,
				UpdatedAt: 0001-01-01
			}
		],
		Signatures: 
		[
			{
				SignatureRecordID: 0,
				EntityType: String,
				EntityID: 0,
				Role: String,
				SignerName: String,
				SignerContactID: 0,
				SignerUserId: String,
				Method: String,
				ImageAttachmentId: 00000000000000000000000000000000,
				ImageUrl: String,
				ImageHash: String,
				DocumentHash: String,
				ConsentText: String,
				IpAddress: String,
				UserAgent: String,
				SignedAt: 0001-01-01
			}
		],
		Actions: 
		[
			String
		]
	}
}